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 plugin , getCurrentInstance() 开发环境与生产环境结果不一致 #7718

Closed
linfun486 opened this issue Sep 25, 2020 · 1 comment
Labels
F-vue3 Framework - Vue 3 T-weapp Target - 编译到微信小程序 V-3 Version - 3.x

Comments

@linfun486
Copy link

相关平台

微信小程序

复现仓库

https://github.com/linfun486/taro-2020.9.24-issue
小程序基础库: 2.13.0
使用框架: Vue 3

复现步骤

通过 taro build --type weapp --watch�打包出的结果正常
通过taro build --type weapp 打包的结果异常, 具体表现为:

  1. const {ctx} = getCurrentInstance(), 这里的ctx两种打包方式下取值不同
  2. ctx.$plugins 均undefined

期望结果

开发环境与生产环境打包结果一致

实际结果

打包结果不一致, 产生报错,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 

@taro-bot2 taro-bot2 bot added F-vue3 Framework - Vue 3 T-weapp Target - 编译到微信小程序 V-3 Version - 3.x labels Sep 25, 2020
@Chen-jj
Copy link
Contributor

Chen-jj commented Oct 15, 2020

@Chen-jj Chen-jj closed this as completed Oct 15, 2020
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

No branches or pull requests

2 participants