vant icon indicating copy to clipboard operation
vant copied to clipboard

[Bug Report] Toast 轻提示组件全局引用后,无法通过this.$toast调用

Open chenmcake opened this issue 6 years ago • 2 comments

设备 / 浏览器

谷歌浏览器: 版本 79.0.3945.88(正式版本) (64 位)

Vant 版本

2.3.3

Vue版本

2.6.10

描述问题

更新完后发现,用过this.$toast的方式去调用轻提示报错,找不到这个方法。 [Vue warn]: Error in v-on handler: "TypeError: this.$toast is not a function"

chenmcake avatar Dec 23 '19 03:12 chenmcake

你试试toast 或者是this.toast吧

OnlyLady avatar Dec 23 '19 07:12 OnlyLady

你试试toast 或者是this.toast吧

我之前一直用的是this,$toast,一直到[email protected]开始就获取不到了,后来我问了一下度娘,说是我的vue-template-compiler版本跟Vue版本不一致,我的vue是2.6.10,而vue-template-compiler是2.5.21,我把他两都升级到2.6.11就没问题了。 好奇怪之前一直不一致都没事,这次更新才发现这个问题。

chenmcake avatar Dec 23 '19 07:12 chenmcake