关于wxs脚本 事件绑定
publish.wxs内容
var publish = function (res){ wx.navigateTo({ url: '/pages/addArticle/addArticle' , success: function (res) { }, fail: function (res) { }, complete: function (res) { }, }) } module.exports = { publish: publish, hello: "hello" }; |
wxml 引入/publish.wxs
<wxs src= "./publish.wxs" module= "publish" /> <template name= "publish" > <view class= "icon-font icon-fabiao publish-btn" bindtap= 'publish.publish' >{{publish.hello}} {publish.publish}}</view> </template> |
结果
“hello”
function (nv_res){nv_console.nv_log("publish ");nv_wx.nv_navigateTo(({nv_url:’/pages/addArticle/addArticle’,nv_success:(function (nv_res){}),nv_fail:(function (nv_res){}),nv_complete:(function (nv_res){}),}))}
但是 bindtap=
‘publish.publish’
没有执行方法跳转