Files
it-console/code/web/IT工具综合平台/src/utils/global.js
2023-01-31 19:51:48 +08:00

42 lines
1.2 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.

/*
* @Author: Kane
* @Date: 2023-01-30 17:06:10
* @LastEditors: Kane
* @LastEditTime: 2023-01-31 16:24:19
* @FilePath: \IT工具综合平台\src\utils\global.js
* @Description: 全局方法
*
* Copyright (c) ${2022} by Kane, All Rights Reserved.
*/
import { ElMessageBox } from "element-plus";
const globalFunction = {
deleteConfirm: () =>
{
ElMessageBox.confirm("确认删除当前数据吗,删除后无法恢复!", "提示",
{
confirmButtonText: "确定",
cancelButtonText: "取消",
showClose: false,
closeOnClickModal: false,
closeOnPressEscape: false,
type: "warning",
}
).then(() => { });
},
message: (param) =>
{
console.log(param);
},
};
export default {
//vue的use函数会调用参数对象的install函数进行安装工作本质上就是往vue实例对象的config.properties
//属性添加对象或方法。
install(app)
{
app.config.globalProperties["deleteConfirm"] = globalFunction.deleteConfirm;
app.config.globalProperties["message"] = globalFunction.message;
},
};