dcloudio / uni-app

A cross-platform framework using Vue.js
https://uniapp.dcloud.io
Apache License 2.0
40.18k stars 3.64k forks source link

[Bug report] 头条小程序在 computed 中拿不到 inject 进来的相关数据 #1822

Closed auven closed 4 years ago

auven commented 4 years ago

问题描述 provide/inject 在其他端都使用正常,只有头条小程序有问题。并且头条小程序中,也只有在 computed 里拿不到,在 methods 和生命周期里都是拿得到的。

复现步骤 https://github.com/auven/vant-weapp-convert-uniapp/blob/master/src/packages/van-grid-item/van-grid-item.vue

实际结果 image

系统信息:

uni-app v2.7.13
uni-app cli v2.0.0-alpha-27920200615002

Environment Info:

  System:
    OS: macOS 10.15.3
    CPU: (8) x64 Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz
  Binaries:
    Node: 10.15.3 - /usr/local/bin/node
    Yarn: Not Found
    npm: 6.4.1 - /usr/local/bin/npm
  Browsers:
    Chrome: 83.0.4103.106
    Firefox: Not Found
    Safari: 13.0.5
  npmPackages:
    @dcloudio/types: ^1.0.2 => 1.0.2 
    @dcloudio/uni-app-plus: ^2.0.0-alpha-27920200615002 => 2.0.0-alpha-27920200615002 
    @dcloudio/uni-app-plus-nvue:  0.0.1 
    @dcloudio/uni-app-plus-nvue-v8:  0.0.1 
    @dcloudio/uni-automator: ^2.0.0-alpha-27920200615002 => 2.0.0-alpha-27920200615002 
    @dcloudio/uni-cli-shared: ^2.0.0-alpha-27920200615002 => 2.0.0-alpha-27920200615002 
    @dcloudio/uni-h5: ^2.0.0-alpha-27920200615002 => 2.0.0-alpha-27920200615002 
    @dcloudio/uni-helper-json: * => 1.0.5 
    @dcloudio/uni-migration: ^2.0.0-alpha-27920200615002 => 2.0.0-alpha-27920200615002 
    @dcloudio/uni-mp-alipay: ^2.0.0-alpha-27920200615002 => 2.0.0-alpha-27920200615002 
    @dcloudio/uni-mp-baidu: ^2.0.0-alpha-27920200615002 => 2.0.0-alpha-27920200615002 
    @dcloudio/uni-mp-qq: ^2.0.0-alpha-27920200615002 => 2.0.0-alpha-27920200615002 
    @dcloudio/uni-mp-toutiao: ^2.0.0-alpha-27920200615002 => 2.0.0-alpha-27920200615002 
    @dcloudio/uni-mp-weixin: ^2.0.0-alpha-27920200615002 => 2.0.0-alpha-27920200615002 
    @dcloudio/uni-quickapp-native: ^2.0.0-alpha-27920200615002 => 2.0.0-alpha-27920200615002 
    @dcloudio/uni-quickapp-webview: ^2.0.0-alpha-27920200615002 => 2.0.0-alpha-27920200615002 
    @dcloudio/uni-stat: ^2.0.0-alpha-27920200615002 => 2.0.0-alpha-27920200615002 
    @dcloudio/uni-template-compiler: ^2.0.0-alpha-27920200615002 => 2.0.0-alpha-27920200615002 
    @dcloudio/vue-cli-plugin-hbuilderx: ^2.0.0-alpha-27920200615002 => 2.0.0-alpha-27920200615002 
    @dcloudio/vue-cli-plugin-uni: ^2.0.0-alpha-27920200615002 => 2.0.0-alpha-27920200615002 
    @dcloudio/vue-cli-plugin-uni-optimize: ^2.0.0-alpha-27920200615002 => 2.0.0-alpha-27920200615002 
    @dcloudio/webpack-uni-mp-loader: ^2.0.0-alpha-27920200615002 => 2.0.0-alpha-27920200615002 
    @dcloudio/webpack-uni-nvue-loader:  0.0.1 
    @dcloudio/webpack-uni-pages-loader: ^2.0.0-alpha-27920200615002 => 2.0.0-alpha-27920200615002 
    @hap-toolkit/dsl-vue:  0.6.13 
    @vue/babel-helper-vue-jsx-merge-props:  1.0.0 
    @vue/babel-plugin-transform-vue-jsx:  1.1.2 
    @vue/babel-preset-app:  4.3.1 
    @vue/babel-preset-jsx:  1.1.2 
    @vue/babel-sugar-functional-vue:  1.1.2 
    @vue/babel-sugar-inject-h:  1.1.2 
    @vue/babel-sugar-v-model:  1.1.2 
    @vue/babel-sugar-v-on:  1.1.2 
    @vue/cli-overlay:  4.3.1 
    @vue/cli-plugin-babel: ~4.3.0 => 4.3.1 
    @vue/cli-plugin-router:  4.3.1 
    @vue/cli-plugin-vuex:  4.3.1 
    @vue/cli-service: ~4.3.0 => 4.3.1 
    @vue/cli-shared-utils:  4.3.1 
    @vue/component-compiler-utils:  3.1.2 (3.1.2)
    @vue/preload-webpack-plugin:  1.1.1 
    @vue/web-component-wrapper:  1.2.0 
    eslint-plugin-vue: ^6.2.2 => 6.2.2 
    mpvue-page-factory:  1.0.1 
    mpvue-template-compiler:  1.0.13 
    uni-h5-vue:  2.6.10 
    uni-mp-vue:  2.6.10 
    vue: ^2.6.11 => 2.6.11 
    vue-eslint-parser:  7.1.0 
    vue-hot-reload-api:  2.3.4 
    vue-loader:  15.9.2 (15.9.2)
    vue-router:  3.0.1 
    vue-style-loader:  4.1.2 
    vue-template-compiler: ^2.6.11 => 2.6.11 
    vue-template-es2015-compiler:  1.9.1 
    vuex: ^3.2.0 => 3.4.0 
  npmGlobalPackages:
    @vue/cli: 4.3.1
fxy060608 commented 4 years ago

目前头条小程序是会有此问题,平台底层实现限制导致

auven commented 4 years ago

@fxy060608 好的,明白了