wx-charts icon indicating copy to clipboard operation
wx-charts copied to clipboard

如何在component({})组件中使用

Open CoderJingt opened this issue 6 years ago • 4 comments

CoderJingt avatar Jan 21 '19 05:01 CoderJingt

你好,我在component({})中使用不了,在页面正常,您的问题有解决的方案了吗?

0131LWG avatar Feb 26 '19 06:02 0131LWG

同问

hdsuperman avatar Nov 26 '19 06:11 hdsuperman

在他的js文件里初始化canvas的时候是默认按page里初始化的,在组件中使用canvas时需要在后面再加一个参数this(page中好像是默认的),在1928行的地方,1913行的构造函数参数里把这个this也加上就可以用了 image

image

原因:https://blog.csdn.net/Andrew83/article/details/88716874 image

WestwoodMaki avatar Dec 03 '19 03:12 WestwoodMaki

在他的js文件里初始化canvas的时候是默认按page里初始化的,在组件中使用canvas时需要在后面再加一个参数this(page中好像是默认的),在1928行的地方,1913行的构造函数参数里把这个this也加上就可以用了 image

image

原因:https://blog.csdn.net/Andrew83/article/details/88716874 image

还有在new这个对象的时候,要把components里的this传进去。。。

GloryXia avatar May 05 '20 11:05 GloryXia