小程序中怎么引入wepy.js第三方toast组件
时间:2018-10-19 14:11:07
收藏:0
阅读:1591
1.先安装组件
npm install wepy-com-toast --save
2.引入wepy和toast
import wepy from 'wepy'
import Toast from 'wepy-com-toast'
3.在组件里面去定义
components = {
toast: Toast,
purchaselist:purchaseList,
reportlist:reportList,
}
4.去定义图标以及文字
toast (title) {
let promise = this.$invoke('toast', 'show', {
title: title,
img: ''
})
promise.then((d) => {
// console.log('toast done')
})
}
评论(0)