<template>
  <web-view :src="url"></web-view>
</template>
 
<script setup>
import { ref } from 'vue'
import { onLoad, onShareAppMessage } from '@dcloudio/uni-app'

const url = ref('')

onLoad((options) => {
  // 传入需要跳转的链接 使用web-view标签进行跳转
  url.value = decodeURIComponent(options.url)

  wx.showShareMenu({
    withShareTicket: true,
    menus: ['shareAppMessage']
  })
  onShareAppMessage(() => {
    return {
      title: options?.title || '门墩儿 专注顶尖招聘',
      path: '/pages/addWebView/index?url=' + encodeURIComponent(url.value)
    }
  })
})

</script>