tab-template.wxml
<template name="tab-template">
<button bindtap="onshow" wx:if="{{show}}"></button>
<view class="wrapper" wx:if="show">
<view class="main">xx</view>
</view>
</template>
app.js
App({
onshow:function() {
this.setData({show:true});
},
globalData: {
show:false
}
});
wrote a custom tab template, and now I want to add several functions to it, because there are many pages to call, one by one is very troublesome, how to make the defined functions universal?