cangku / easy-work

22 stars 7 forks source link

taro next无法使用 #14

Open yz1311 opened 4 years ago

yz1311 commented 4 years ago

如果有空麻烦修改下,这边尝试简单讲react引入,还是会报其他的错

yz1311 commented 4 years ago

将taro的引入全部改为

import React, {Component} from 'react';
import Taro, {  } from '@tarojs/taro';

编译问题解决了,然后运行会报

TypeError: Cannot read property '__wxWebviewId__' of undefined
    at n.value (VM17978 WAService.js:2)
    at EcCanvas.init (ec-canvas.js:39)
    at Echart.initChart (index.js:41)
    at Echart.componentDidMount (index.js:58)
    at commitLifeCycles (react-reconciler.development.js:12076)
    at commitLayoutEffects (react-reconciler.development.js:15314)
    at Object.invokeGuardedCallbackImpl (react-reconciler.development.js:11540)
    at invokeGuardedCallback (react-reconciler.development.js:11712)
    at commitRootImpl (react-reconciler.development.js:15053)
    at unstable_runWithPriority (scheduler.development.js:817)

通过调试发现是 https://github.com/cangku/easy-work/blob/develop/components/echarts/src/components/echart/ec-canvas.js#L42

var query = Taro.createSelectorQuery().in(this.$scope);

this.$scope为undefined,但是我对taro的这些不太熟,想请教下报错原因是什么?

cangku commented 4 years ago

最近业务有些忙,我先看下。感谢反馈。