Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

onShareAppMessage 在 Hbuild X 中 setup写法不生效。(微信小程序分享) #5304

Open
ywenhao opened this issue Feb 11, 2025 · 0 comments

Comments

@ywenhao
Copy link

ywenhao commented Feb 11, 2025

Hbuild X 版本4.45
uniapp vue3

这样不行,在微信小程序参数不生效,但是callback是执行了的

<script setup>
import { onShareAppMessage } from '@dcloudio/uni-app'

onShareAppMessage(() => {
  console.log('分享') // 这里会打印,下面的参数不生效
  return {
    title: '测试',
    path: '/pages/index/index'
  }
})
</script>

这样是可以的

<script>
export default {
  onShareAppMessage() {
    return {
      title: '测试',
      path: '/pages/index/index'
    }
   },
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant