From 90fc12f59774b51812f07deb4e1aa1f5fa0fa627 Mon Sep 17 00:00:00 2001 From: zhouxinyu Date: Tue, 6 Aug 2024 15:35:28 +0800 Subject: [PATCH] fix: fix issue with harmony props ignore function --- .../harmony_vchart/entry/src/main/ets/pages/Chart.ets | 9 +++++++-- packages/harmony_vchart/library/BuildProfile.ets | 2 +- .../library/src/main/ets/ChartComponent.ets | 2 +- rush.json | 2 +- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/packages/harmony_vchart/entry/src/main/ets/pages/Chart.ets b/packages/harmony_vchart/entry/src/main/ets/pages/Chart.ets index 5e998a3e92..6105bb3e93 100644 --- a/packages/harmony_vchart/entry/src/main/ets/pages/Chart.ets +++ b/packages/harmony_vchart/entry/src/main/ets/pages/Chart.ets @@ -3,6 +3,7 @@ import { VChart } from '@visactor/harmony-vchart'; // import { VisActor } from './canvas'; import { router } from '@kit.ArkUI'; import promptAction from '@ohos.promptAction'; +import lineSpec from './data/line'; interface IRouterParams { label: string, @@ -14,10 +15,14 @@ const params: IRouterParams = router.getParams() as IRouterParams; @Entry @Component struct Chart { - @State spec: Object = params.spec; + @State spec: Object | null = null; private t: number = 0; @State delta: number = 0; + onPageShow(): void { + this.spec = params.spec; + } + build() { Row() { Column() { @@ -26,7 +31,7 @@ struct Chart { .fontWeight(FontWeight.Bold) // Stage({ bg: 'red', h: 500 }) VChart({ - spec: params.spec, w: 300, h: 300, + spec: this.spec, w: 300, h: 300, onChartInitCb: () => {}, onChartReadyCb: () => {}, initOption: { diff --git a/packages/harmony_vchart/library/BuildProfile.ets b/packages/harmony_vchart/library/BuildProfile.ets index d19b5096b2..cbaf3be260 100644 --- a/packages/harmony_vchart/library/BuildProfile.ets +++ b/packages/harmony_vchart/library/BuildProfile.ets @@ -1,5 +1,5 @@ export default class BuildProfile { - static readonly HAR_VERSION = '1.11.3'; + static readonly HAR_VERSION = '1.11.10'; static readonly BUILD_MODE_NAME = 'debug'; static readonly DEBUG = true; } \ No newline at end of file diff --git a/packages/harmony_vchart/library/src/main/ets/ChartComponent.ets b/packages/harmony_vchart/library/src/main/ets/ChartComponent.ets index f052a7570f..3d1ea54c39 100644 --- a/packages/harmony_vchart/library/src/main/ets/ChartComponent.ets +++ b/packages/harmony_vchart/library/src/main/ets/ChartComponent.ets @@ -80,7 +80,7 @@ export struct VChart { private context: CanvasRenderingContext2D = new CanvasRenderingContext2D(this.settings) private w: number = 300; private h: number = 300; - @Prop @Watch('onSpecUpdate') private spec: Object | null = null; + @Link @Watch('onSpecUpdate') private spec: Object | null; private vchart: VChartConstructor | null = null; @State time: string = ''; diff --git a/rush.json b/rush.json index ee6bd5120f..d989f0e08a 100644 --- a/rush.json +++ b/rush.json @@ -125,4 +125,4 @@ "shouldPublish": false } ] -} \ No newline at end of file +}