Skip to content

Commit 2ab2f24

Browse files
committed
feat: 支持分享
1 parent f026195 commit 2ab2f24

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

src/pages/index/index.vue

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@
315315
</template>
316316

317317
<script setup lang="ts">
318-
import Taro from "@tarojs/taro";
318+
import Taro, { useLoad } from "@tarojs/taro";
319319
import { computed, onMounted, ref, watch } from "vue";
320320
import {
321321
DEFAULT_SOURCE_ID,
@@ -622,6 +622,14 @@ onMounted(async () => {
622622
}
623623
});
624624
625+
useLoad(async (options) => {
626+
// 支持分享
627+
Taro.showShareMenu({
628+
withShareTicket: true,
629+
showShareItems: ["wechatFriends", "wechatMoment"],
630+
});
631+
});
632+
625633
watch(
626634
[
627635
surname,

0 commit comments

Comments
 (0)