first commit
This commit is contained in:
34
衣莎项目/源码/YiShaXiYi/model/message.js
Normal file
34
衣莎项目/源码/YiShaXiYi/model/message.js
Normal file
@@ -0,0 +1,34 @@
|
||||
import { $Toast } from "./../extend/iview/dist/base/index"
|
||||
|
||||
export class Msg {
|
||||
/**
|
||||
* 提示消息
|
||||
* @param {string} content 提示内容
|
||||
* @param {string} type 内置的类型,可选值为 default,success,warning,error,loading String default
|
||||
* @param {Number} duration 持续时间,单位秒,设置为 0 则不自动关闭,需调用 $Toast.hide() 方法手动关闭
|
||||
* @param {String} icon 自定义图标
|
||||
* @param {String} image 自定义图片地址
|
||||
* @param {Boolean} mask 是否显示一个隐藏的遮罩层,点击遮罩层可立即关闭组件true
|
||||
* @param {String} selector 组件标识 #toast
|
||||
*/
|
||||
dataMsg(data) {
|
||||
data.mask = data.mask || false
|
||||
try {
|
||||
$Toast(data)
|
||||
} catch (error) {
|
||||
console.log(error, "提示消息出错")
|
||||
}
|
||||
}
|
||||
}
|
||||
// const dataMsg = (data) => {
|
||||
// data.mask = data.mask || false
|
||||
// try {
|
||||
// $Toast(data)
|
||||
// } catch (error) {
|
||||
// console.log(error, "提示消息出错")
|
||||
// }
|
||||
// }
|
||||
|
||||
// module.exports = {
|
||||
// dataMsg: dataMsg,
|
||||
// }
|
||||
Reference in New Issue
Block a user