Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vue3中使用的问题 #39

Open
louyuoops opened this issue Jun 9, 2022 · 0 comments
Open

vue3中使用的问题 #39

louyuoops opened this issue Jun 9, 2022 · 0 comments

Comments

@louyuoops
Copy link

louyuoops commented Jun 9, 2022

vue3中需要修改一下uni-ec-canvas.vue中的initChart方法

initChart(canvas, width, height, canvasDpr) {
		  console.log("probe6:", canvas, width, height, canvasDpr)
        const chart = echarts.init(canvas, null, {
          width: width,
          height: height,
          devicePixelRatio: canvasDpr
        });
        canvas.setChart(chart);
		console.log("probe3:", chart)
		if (!chart) {
			// this.initChart(canvas, width, height, canvasDpr)
			return
		}
        chart.setOption(this.ec.option);
		console.log("probe4")
        this.$emit('inited', chart)
        return chart
      }

把this.$curChart更换为局部变量(我也不太明白为啥,没有仔细学过js和vue)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant