index.vue 607 B

123456789101112131415161718192021222324252627
  1. <template>
  2. <web-view :src="url"></web-view>
  3. </template>
  4. <script setup>
  5. import { ref } from 'vue'
  6. import { onLoad, onShareAppMessage } from '@dcloudio/uni-app'
  7. const url = ref('')
  8. onLoad((options) => {
  9. // 传入需要跳转的链接 使用web-view标签进行跳转
  10. url.value = decodeURIComponent(options.url)
  11. wx.showShareMenu({
  12. withShareTicket: true,
  13. menus: ['shareAppMessage']
  14. })
  15. onShareAppMessage(() => {
  16. return {
  17. title: options?.title || '门墩儿 专注顶尖招聘',
  18. path: '/pages/addWebView/index?url=' + encodeURIComponent(url.value)
  19. }
  20. })
  21. })
  22. </script>