转换为elementUI提示方法为uni-app的showToast提示

javascript 复制代码
// 转换为elementUI提示方法为uni-app的showToast提示----------------------------------------
// 一般提示
Vue.prototype.$message = function(title) {
	title && uni.showToast({
		icon: `none`,
		title
	});
};
// 成功提示
Vue.prototype.$message.success = (title) => {
	title && uni.showToast({
		title
	});
};
// 失败提示
Vue.prototype.$message.error = (title) => {
	title && uni.showToast({
		icon: `error`,
		title
	});
};
// 警告提示
Vue.prototype.$message.warning = (title) => {
	title && uni.showToast({
		icon: `exception`,
		title
	});
};

MessageBox 弹框 全局方法msgbox, alert, confirm 和 prompt常用代码片段_setup使用msgbox-CSDN博客文章浏览阅读302次。【代码】MessageBox 弹框 全局方法msgbox, alert, confirm 和 prompt常用代码片段。_setup使用msgboxhttps://blog.csdn.net/qq_37860634/article/details/137027367

相关推荐
ruanno_top2 小时前
点全选,已选的被清空了:Transfer 三态复选框的三个 bug
vue.js
时间的情敌3 小时前
Cesium 加载 3D Tiles 倾斜摄影、压平、样式设置(Vue3 实战)
vue.js·3d·cesium
usdoc文档预览20 小时前
USDOC系列之PPT文件在线编辑-VUE前端实现在线浏览器在线编辑PPT文档
前端·vue.js·编辑器·office365·ppt在线编辑·office文件在线编辑·文件在线编辑
Java小卷20 小时前
面向 schema 编程,轻松搞定 Element 虚拟化表格复杂应用场景
vue.js·低代码·element
仨孩子的爹21 小时前
Lodop、hiprint 与 vue-print-designer:打印控件选型对比
vue.js
ruanno_top1 天前
四个 canvas 组件,在 2 倍屏上一直是糊的
vue.js
Dumbness1 天前
订阅消息弹窗必须在用户点击里调:联调实验室里 timing 和 Mock 支付通知踩的坑
javascript·uni-app
ruanno_top1 天前
一个脏数据能让整条折线消失:图表组件的四种数据契约
vue.js
FlyWIHTSKY2 天前
vue2和vue3有什么区别,用法上有哪些区别
前端·javascript·vue.js
ruanno_top2 天前
能点,但 Tab 不到:两个组件把「可操作」做了一半
vue.js