From bccdb8f81c07c8a9cdcd6838173dfd1c73c98d90 Mon Sep 17 00:00:00 2001
From: zhou zhou <3272660260@qq.com>
Date: 星期四, 26 二月 2026 16:05:30 +0800
Subject: [PATCH] #

---
 main.js |   24 ++++++++++++++++++++++++
 1 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/main.js b/main.js
index c04e6b7..9308a85 100644
--- a/main.js
+++ b/main.js
@@ -18,6 +18,19 @@
 import uView from '@/uni_modules/uview-ui'
 Vue.use(uView)
 
+Vue.mixin({
+	methods: {
+		$showToast(options) {
+			if (this.$refs.uToast) {
+				this.$refs.uToast.show(options);
+			} else {
+				// Fallback if component not found or loaded yet
+				uni.$u.toast(typeof options === 'string' ? options : (options.message || options.title));
+			}
+		}
+	}
+})
+
 const i18n = new VueI18n(i18nConfig)
 const app = new Vue({
 	...App,
@@ -38,6 +51,17 @@
 export function createApp() {
 	const app = createSSRApp(App)
 	app.use(uView)
+	app.mixin({
+		methods: {
+			$showToast(options) {
+				if (this.$refs.uToast) {
+					this.$refs.uToast.show(options);
+				} else {
+					uni.$u.toast(typeof options === 'string' ? options : (options.message || options.title));
+				}
+			}
+		}
+	})
 	return {
 		app
 	}

--
Gitblit v1.9.1