method命名都检查都正确,死活提示缺少method。这是报错:Component "pages/classic" does not have a method "onPrevious" to handle event "right".//这里是子组件中的methods 和 wxml
methods: {
onNext: function (event) { if (!this.properties.latest) { this.triggerEvent('left', {}, {})
}
},
onPrevious: function (event) { if (!this.properties.first) { this.triggerEvent('right', {}, {})
}
}
}
---------------------------------------------
<view class="container">
<image bind:tap="onNext" class="icon" src="{{latest?disLeftSrc:leftSrc}}"/>
<text class="title">{{title}}</text>
<image bind:tap="onPrevious" class="icon" src="{{first?disRightSrc:rightSrc}}"/>
</view>这里是page中的结构
<navi-cmp bind:left="onNext" bind:right="onPrevious" title="{{classic.title}}" first="{{first}}" latest="{{latest}}" class="navi" />
添加回答
举报
0/150
提交
取消