We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
微信小程序
https://github.com/linfun486/taro-2020.9.24-issue 小程序基础库: 2.13.0 使用框架: Vue 3
通过 taro build --type weapp --watch�打包出的结果正常 通过taro build --type weapp 打包的结果异常, 具体表现为:
开发环境与生产环境打包结果一致
打包结果不一致, 产生报错,vue3 plugin product下无法undefined
Taro CLI 3.0.11 environment info: System: OS: macOS 10.15.6 Shell: 5.7.1 - /bin/zsh Binaries: Node: 12.18.4 - /usr/local/bin/node Yarn: 1.22.5 - /usr/local/bin/yarn npm: 6.14.6 - /usr/local/bin/npm npmPackages: @tarojs/components: 3.0.11 => 3.0.11 @tarojs/mini-runner: 3.0.11 => 3.0.11 @tarojs/runtime: 3.0.11 => 3.0.11 @tarojs/taro: 3.0.11 => 3.0.11 @tarojs/webpack-runner: 3.0.11 => 3.0.11 babel-preset-taro: 3.0.11 => 3.0.11 eslint-config-taro: 3.0.11 => 3.0.11
The text was updated successfully, but these errors were encountered:
@linfun486 Vue3 就是这样设定的,ctx 在生产环境不会做属性定义:
https://github.com/vuejs/vue-next/blob/a66e53a24f445b688eef6812ecb872dc53cf2702/packages/runtime-core/src/component.ts#L471-L475
你可以这样做:
const instance = getCurrentInstance(); instance.proxy.$support.helloWorld()
instance.proxy 是暴露给用户的 API,里面代理了全局变量。
https://github.com/vuejs/vue-next/blob/a66e53a24f445b688eef6812ecb872dc53cf2702/packages/runtime-core/src/component.ts#L555
https://github.com/vuejs/vue-next/blob/6ba7ba47d59288b8cd39c985a2163ebd220607bc/packages/runtime-core/src/componentPublicInstance.ts#L317-L322
Sorry, something went wrong.
No branches or pull requests
相关平台
微信小程序
复现仓库
https://github.com/linfun486/taro-2020.9.24-issue
小程序基础库: 2.13.0
使用框架: Vue 3
复现步骤
通过 taro build --type weapp --watch�打包出的结果正常
通过taro build --type weapp 打包的结果异常, 具体表现为:
期望结果
开发环境与生产环境打包结果一致
实际结果
打包结果不一致, 产生报错,vue3 plugin product下无法undefined
环境信息
The text was updated successfully, but these errors were encountered: