收藏
回答

selectComponent返回null?

WXML

<view class="echarts_box">

<ec-canvas id="mychart-dom-line" canvas-id="mychart" ec="{{ ec }}"></ec-canvas>

</view>

JS 

onReady: function () {

    // 获取组件

    this.ecComponent = this.selectComponent('#mychart');

    // this.init()

    console.log('this.ecComponent', this.ecComponent)

  },


JSON

{

  "usingComponents": {

    "ec-canvas": "../../ec-canvas/ec-canvas",

    "van-popup": "@vant/weapp/popup/index",

    "van-datetime-picker": "@vant/weapp/datetime-picker/index",

    "van-picker": "@vant/weapp/picker/index"

  }

}

不管我怎么写 返回的都是null


最后一次编辑于  2021-05-31
回答关注问题邀请回答
收藏

1 个回答

  • 微喵网络
    微喵网络
    2021-05-31

    2021-05-31
    有用
    回复
登录 后发表内容