Files
CompanyProject/衣莎项目/源码/YiShaXiYi/model/message.js
2024-09-27 01:32:49 +08:00

34 lines
1.1 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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,
// }