另,开发了lazyLoad模式,可以在页面及组件加载完毕后,再设置storyid,加载故事节点,完成故事星图绘制;
但调用方式比较别扭,比如需要通过这种方式获取页面上组件实例:
var my_storychart = this.$wx.selectComponent('#mychart-dom-bar1')
然后调用:
my_storychart.manual_init(storyid)
在manual_init的实现中,是通过如下语句获取封装的ec-canvas组件:
this.$wepy.$wx.selectComponent('#id').data.storyid = storyid
this.$wepy.$wx.selectComponent('#id').init()
虽然work,但这些写法总觉得别扭.