Skip to content

Commit 6aa8d6d

Browse files
committed
update according to the review
1 parent 3556afe commit 6aa8d6d

File tree

6 files changed

+22
-6
lines changed

6 files changed

+22
-6
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ See more examples [here](https://github.com/ecomfe/vue-echarts/tree/main/demo).
156156
ECharts' universal interface. Modifying this prop will trigger ECharts' `setOption` method. Read more [here →](https://echarts.apache.org/en/option.html)
157157

158158
> [!TIP]
159-
> When `update-options` is not specified, `notMerge: false` will be specified by default when the `setOption` method is called if the `option` object is modified directly and the reference remains unchanged; otherwise, if a new reference is bound to `option`, ` notMerge: true` will be specified.
159+
> When `update-options` is not specified, `notMerge: false` will be specified by default when the `setOption` method is called if the `option` object is modified directly and the reference remains unchanged; otherwise, if a new reference is bound to `option`, `notMerge: true` will be specified.
160160
161161
- `update-options: object`
162162

@@ -376,7 +376,7 @@ Vue-ECharts allows you to define ECharts option's `tooltip.formatter` callbacks
376376
</template>
377377
```
378378

379-
[Example→](https://vue-echarts.dev/#line)
379+
[Example ](https://vue-echarts.dev/#line)
380380

381381
</details>
382382

README.zh-Hans.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ Vue-ECharts 允许你通过 Vue 插槽来定义 ECharts 配置中的 `tooltip.fo
376376
</template>
377377
```
378378

379-
[Example](https://vue-echarts.dev/#line)
379+
[示例 ](https://vue-echarts.dev/#line)
380380

381381
</details>
382382

demo/data/line.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
export default function getData() {
22
return {
3+
textStyle: {
4+
fontFamily: 'Inter, "Helvetica Neue", Arial, sans-serif',
5+
fontWeight: 300,
6+
},
37
legend: { top: 20 },
48
tooltip: {
59
trigger: "axis",

demo/examples/LineChart.vue

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,14 @@ function getPieOption(params) {
3737
borderColor: "#fff",
3838
borderWidth: 2,
3939
},
40-
label: { position: "center", formatter: params[0].name },
40+
label: {
41+
position: "center",
42+
formatter: params[0].name,
43+
textStyle: {
44+
fontFamily: 'Inter, "Helvetica Neue", Arial, sans-serif',
45+
fontWeight: 300,
46+
},
47+
},
4148
},
4249
],
4350
};

src/composables/tooltip.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ export function useTooltip(slots: Slots, onSlotsChange: () => void) {
6565
// shallow-clone the link; create empty shell if missing
6666
cur[seg] = next
6767
? Array.isArray(next)
68-
? next.slice()
68+
? [...next]
6969
: { ...next }
7070
: isValidArrayIndex(seg)
7171
? []

src/utils.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,10 @@ export function toValue<T>(source: MaybeRefOrGetter<T>): T {
3232

3333
export function isValidArrayIndex(key: string): boolean {
3434
const num = Number(key);
35-
return Number.isInteger(num) && num >= 0 && num < Math.pow(2, 32) - 1;
35+
return (
36+
Number.isInteger(num) &&
37+
num >= 0 &&
38+
num < Math.pow(2, 32) - 1 &&
39+
String(num) === key
40+
);
3641
}

0 commit comments

Comments
 (0)