今天帮同事改 bug 发现页面报错如下:
[Vue warn]: Invalid handler for event "click": got undefined
原因:
他的方法没有写到 methods: { } 里面。
解决:
将方法写在 methods 里面就可以了。
methods:{
onChange(event) {
this.setData({ active: event.detail });
}
},今天帮同事改 bug 发现页面报错如下:
[Vue warn]: Invalid handler for event "click": got undefined
原因:
他的方法没有写到 methods: { } 里面。
解决:
将方法写在 methods 里面就可以了。
methods:{
onChange(event) {
this.setData({ active: event.detail });
}
},