Skip to content

Commit 9628cf6

Browse files
authored
Merge pull request #23 from ambit-tsai/dev
fix: "this.$data" is undefined in Vue 3
2 parents 9a09a44 + 23c3b1d commit 9628cf6

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "echarts-for-vue",
3-
"version": "1.4.0",
3+
"version": "1.4.1",
44
"description": "ECharts wrapper component for Vue 3, 2 and TypeScript",
55
"main": "dist/echarts-for-vue.js",
66
"module": "dist/echarts-for-vue.mjs",

src/common-options.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,7 @@ export default {
3131
mounted(this: EChartsComponent) {
3232
// Readonly property "inst"
3333
Object.defineProperty(this, 'inst', {
34-
get(this: EChartsComponent) {
35-
return this.$data._private.inst
36-
},
34+
get: () => this.$data._private.inst,
3735
})
3836
this.init()
3937
},

0 commit comments

Comments
 (0)