weexteam / article

This repos is a third party collection, and is not developed nor maintained by Apache Weex.
1.22k stars 141 forks source link

使用const modal = weex.requireModule('modal'),chorme中报错modal为undefined #201

Open wangyunjiegit opened 6 years ago

wangyunjiegit commented 6 years ago

const modal = weex.requireModule('modal') export default { methods: { showToastA (event) { modal.toast({ message: 'This is a toast', duration: 0.3 }) }, showToastB (event) { modal.toast({ message: 'This toast has no duration' }) }, showToastC (event) { modal.toast({ message: 'This toast has long duration', duration: 10 }) } } };

Cannot read property 'toast' of undefined chorme中报错modal为undefined

ghost commented 6 years ago

我也遇到这个问题了,有解决办法吗?

wangyunjiegit commented 6 years ago

更新weex版本就可以了,旧版本会有这个问题

ghost commented 6 years ago

@wangyunjiegit 你的weex是什么版本的?