转换为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

相关推荐
吴传逞1 小时前
记一次uniapp+nutui-uniapp搭建项目
uni-app
还有多远.1 小时前
jsBridge接入流程
前端·javascript·vue.js·react.js
半花3 小时前
【Vue】defineProps、defineEmits 和 defineExpose
前端·vue.js
我的名字帅不帅3 小时前
使用 Element UI -Container 布局容器时监听屏幕滚动无效
vue.js
用户28003832908403 小时前
升级Vue3.4+版本,ant-design-vue 3.x 版本的Modal函数方式无法关闭问题
vue.js
小菜全3 小时前
uniapp新增页面及跳转配置方法
开发语言·前端·javascript·vue.js·前端框架
雪芽蓝域zzs3 小时前
uni-app倒计时公共组件 封装,倒计时组件
uni-app
小菜全4 小时前
uniapp基础组件概述
前端·css·vue.js·elementui·css3
因吹斯汀5 小时前
一饭封神:当AI厨神遇上你的冰箱,八大菜系大师在线battle!
前端·vue.js·ai编程
崔璨6 小时前
详解Vue3的响应式系统
前端·vue.js