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')
})
}