npm install wx-tips # npm安装方式
yarn add wx-tips # yarn安装方式
// utils/tips.js
import tips from 'wx-tips'
export default const instance = tips.getInstance({
errorIconPath: '/images/error.png', // 错误提示图片路径 必须提供
alertIconPath: '/images/alert.png', // alert提示图片路径 必须提供
loadingMode: 'Loading' // 选项 NavigationBarLoading|Loading
})
static getInstance(config = {}) this
success(title, duration = '') Promise
modal(content = '', title = '') Promise
confirm(content, payload = {}, title) Promise
toast(title, hideCallback, icon = 'success', duration = '')
loading(title = '', force = false)
loaded()
alert(title, duration = '') Promise
error(title, hideCallback, duration = '')
setLoading()