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

开启vue3 的 __VUE_OPTIONS_API__ 配置会让小程序的useDidShow等钩子失效 #11393

Closed
AsherSun opened this issue Mar 4, 2022 · 2 comments · Fixed by #11440
Closed
Labels
F-vue3 Framework - Vue 3 T-weapp Target - 编译到微信小程序 V-3 Version - 3.x
Milestone

Comments

@AsherSun
Copy link

AsherSun commented Mar 4, 2022

相关平台

微信小程序

复现仓库

https://github.com/AsherSun/taro-vue3-config
小程序基础库: 2.21.4
使用框架: Vue 3

复现步骤

  1. 使用Taro vue3
  2. config/index.js的配置中配置如下代码:
 defineConstants: {
    __VUE_OPTIONS_API__: JSON.stringify(false),
  },
  1. 在项目中使用useDidShow、useReachBottom等钩子,发现并没有调用

期望结果

可以配置vue3的__VUE_OPTIONS_API__: JSON.stringify(false)。用于删除optoins API

实际结果

并没有生效

环境信息

👽 Taro v3.4.2


  Taro CLI 3.4.2 environment info:
    System:
      OS: macOS 11.2.3
      Shell: 5.8 - /bin/zsh
    Binaries:
      Node: 16.4.0 - ~/.nvm/versions/node/v16.4.0/bin/node
      Yarn: 1.22.5 - ~/.yarn/bin/yarn
      npm: 7.19.0 - ~/.nvm/versions/node/v16.4.0/bin/npm
    npmPackages:
      @tarojs/components: 3.4.2 => 3.4.2 
      @tarojs/mini-runner: 3.4.2 => 3.4.2 
      @tarojs/runtime: 3.4.2 => 3.4.2 
      @tarojs/taro: 3.4.2 => 3.4.2 
      @tarojs/webpack-runner: 3.4.2 => 3.4.2 
      babel-preset-taro: 3.4.2 => 3.4.2 
      eslint-config-taro: 3.4.2 => 3.4.2 
@taro-bot2 taro-bot2 bot added F-vue3 Framework - Vue 3 T-weapp Target - 编译到微信小程序 V-3 Version - 3.x labels Mar 4, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Mar 4, 2022

等待热心的小伙伴解决问题中..., 有一些相关的 issues 可能帮助到你!

Thank you so much!

@Chen-jj
Copy link
Contributor

Chen-jj commented Mar 12, 2022

感谢反馈,是因为 Taro 内部插入的中间层组件使用了 Options API 而导致,下个版本修复

Chen-jj added a commit that referenced this issue Mar 26, 2022
* fix(vue3): 使用 setup 语法编写 vue3 内置组件,fix #11393

* fix: ci
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F-vue3 Framework - Vue 3 T-weapp Target - 编译到微信小程序 V-3 Version - 3.x
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants