feat: 新增小程序分享功能 — 全局默认+页面级定制

This commit is contained in:
2026-06-08 10:09:53 +08:00
parent 1abc55323d
commit 8cf240f76b
3 changed files with 72 additions and 2 deletions

View File

@@ -6,5 +6,23 @@ export function createApp() {
const app = createSSRApp(App)
const pinia = createPinia()
app.use(pinia)
// #ifdef MP-WEIXIN
// 全局分享配置,页面可通过定义 onShareAppMessage/onShareTimeline 覆盖
app.mixin({
onShareAppMessage() {
return {
title: '小菜记账 — 轻松记账,快乐生活',
path: '/pages/index/index'
}
},
onShareTimeline() {
return {
title: '小菜记账 — 轻松记账,快乐生活'
}
}
})
// #endif
return { app }
}