From 621d5d4c57568a8a35e81c2cffc16911576e6e0d Mon Sep 17 00:00:00 2001 From: zoujing Date: Mon, 13 Oct 2025 20:04:05 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=AE=9E=E7=8E=B0=E5=B0=8F=E7=A8=8B?= =?UTF-8?q?=E5=BA=8F=E5=88=86=E4=BA=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main.js | 2 ++ src/utils/share.js | 15 +++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 src/utils/share.js diff --git a/src/main.js b/src/main.js index 9143fc7..aac440f 100644 --- a/src/main.js +++ b/src/main.js @@ -1,4 +1,5 @@ import App from "./App"; +import share from "./utils/share"; // #ifndef VUE3 import Vue from "vue"; @@ -21,6 +22,7 @@ export function createApp() { pinia.use(createUnistorage()); app.use(pinia); + app.use(share); return { app, diff --git a/src/utils/share.js b/src/utils/share.js new file mode 100644 index 0000000..620e316 --- /dev/null +++ b/src/utils/share.js @@ -0,0 +1,15 @@ +export default { + install(app) { + app.mixin({ + onLoad() { + const page = getCurrentPages().pop(); + if (page) { + uni.showShareMenu({ + withShareTicket: true, + menus: ["shareAppMessage", "shareTimeline"], + }); + } + }, + }); + }, +};