换成这种试试@afterRead="afterRead"
在mpvue框架中使用vant 上传文件组件<van-uploader>?如题, 我在使用<van-uploader>组件时,准备调用组件自带的方法时,发现methods中事件不起作用!!!! 代码如下: [代码]<van-uploader[代码][代码] [代码][代码]:file-list=[代码][代码]"ldy_files"[代码][代码] [代码][代码]accept=[代码][代码]"all"[代码][代码] [代码][代码]multiple=[代码][代码]"true"[代码][代码] [代码][代码]upload-text=[代码][代码]"点击上传"[代码][代码] [代码][代码]@after-read=[代码][代码]"afterRead()"[代码][代码] [代码][代码]@click-preview=[代码][代码]"onUploadPreview"[代码][代码] [代码][代码]@[代码][代码]delete[代码][代码]=[代码][代码]"onUploadRemove"[代码][代码] [代码][代码]/>[代码][代码][代码] [代码]methods: {[代码][代码] [代码][代码]afterRead (event) {[代码][代码] [代码][代码]console.log([代码][代码]'1111111111111111'[代码][代码])[代码][代码] [代码][代码]console.log(event)[代码][代码] [代码][代码]},[代码][代码]}[代码][代码][代码] [代码]其中@after-read=[代码][代码]"afterRead()"[代码]这个事件的绑定方式用原来的bind:,控制台始终都打印如下字段: VM48403:1 Component "pages/openAccountDetail/main" does not have a method "afterRead" to handle event "after-read". 或者绑定方式换成@,控制台干脆就什么都不打印了 啥情况啊?
2020-09-29