今天帮同事改 bug 发现页面报错如下:
[Vue warn]: Invalid handler for event "click": got undefined
原因:
他的方法没有写到 methods: { } 里面。
解决:
将方法写在 methods 里面就可以了。
methods:{
onChange(event) {
this.setData({ active: event.detail });
}
},
原创文章,作者:506227337,如若转载,请注明出处:https://blog.ytso.com/tech/pnotes/231462.html