template.wxml
<view bindtap="clickView" class="tempClass">temp模板</view>
template.js
var temp = {
clickView: function () {
console.log("刚刚您点击了temp")
}
}
export default temp
index.js
const App = getApp()
import tempObj from '../temp/temp'
//index.js
//获取应用实例
var indexObj = {
onShow() {
console.log("onShow")
}
}
indexObj["clickView"] = tempObj.clickView
Page(indexObj)