Files
chazhi_store/src/hooks/useShare.ts
2026-01-05 00:39:56 +08:00

20 lines
676 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

export default function useShare() {
const miniShareOptions = reactive({
// 分享标题
title: '',
//页面 path不建议直接配置分享哪个页面就配置哪个页面的路径有些页面不建议分享如订单页所以默认都是分享首页
path: '/pages/index/index',
// 分享图标路径可以是本地文件路径、代码包文件路径或者网络图片路径。支持PNG及JPG。显示图片长宽比是 5:4
imageUrl: '',
})
return {
// 发送给朋友
onShareAppMessage() {
return {
...miniShareOptions,
}
}
}
}