在做展示分类列表时 ,点击分类按钮 报错 ?
在做展示分类列表时 ,点击分类按钮 报错
VM60779:1 Do not have toggle handler in current page: pages/topics/index. Please make sure that toggle handler has been defined in pages/topics/index, or pages/topics/index has been added into app.json
代码
computed = {
currentCategoryId () {
return this.currentCategory.id || 0
}
}
methods = {
toggle () {
console.log('toggle is running ....')
this.categoryOpen = !this.categoryOpen
},
async changeCatgory (id = 0) {
// 找到选中的分类
this.currentCategory = id ? this.categories.find(category => category.id === id) : {}
// 点击以后关闭下拉列表
this.categoryOpen = false
this.$apply()
await this.getTopics(1, true)
}
}
我目前没有发现错误原因。。
推荐文章: