fix: fix default behavior for notMerge, close #691

This commit is contained in:
Justineo
2023-02-08 16:22:51 +08:00
parent 4313d301e4
commit 6159c7d684
5 changed files with 13 additions and 10 deletions

View File

@ -1,3 +1,7 @@
## 6.5.3
* Fixed default behavior for `notMerge` option (#691).
## 6.5.2
* Added `dist/csp/*` to support strict CSP with extracted CSS file.

View File

@ -224,13 +224,11 @@ Drop `<script>` inside your HTML file and access the component via `window.VueEC
<summary>Vue 3 <a href="https://stackblitz.com/edit/vue-echarts-vue-3-global?file=index.html">Demo →</a></summary>
<!-- vue3Scripts:start -->
```html
<script src="https://cdn.jsdelivr.net/npm/vue@3.2.45"></script>
<script src="https://cdn.jsdelivr.net/npm/echarts@5.4.1"></script>
<script src="https://cdn.jsdelivr.net/npm/vue-echarts@6.5.2"></script>
<script src="https://cdn.jsdelivr.net/npm/vue-echarts@6.5.3"></script>
```
<!-- vue3Scripts:end -->
```js
@ -246,13 +244,11 @@ app.component('v-chart', VueECharts)
<summary>Vue 2 <a href="https://stackblitz.com/edit/vue-echarts-vue-2-global?file=index.html">Demo →</a></summary>
<!-- vue2Scripts:start -->
```html
<script src="https://cdn.jsdelivr.net/npm/vue@2.7.14"></script>
<script src="https://cdn.jsdelivr.net/npm/echarts@5.4.1"></script>
<script src="https://cdn.jsdelivr.net/npm/vue-echarts@6.5.2"></script>
<script src="https://cdn.jsdelivr.net/npm/vue-echarts@6.5.3"></script>
```
<!-- vue2Scripts:end -->
```js

View File

@ -227,7 +227,7 @@ import "echarts";
```html
<script src="https://cdn.jsdelivr.net/npm/vue@3.2.45"></script>
<script src="https://cdn.jsdelivr.net/npm/echarts@5.4.1"></script>
<script src="https://cdn.jsdelivr.net/npm/vue-echarts@6.5.2"></script>
<script src="https://cdn.jsdelivr.net/npm/vue-echarts@6.5.3"></script>
```
<!-- vue3Scripts:end -->
@ -247,7 +247,7 @@ app.component('v-chart', VueECharts)
```html
<script src="https://cdn.jsdelivr.net/npm/vue@2.7.14"></script>
<script src="https://cdn.jsdelivr.net/npm/echarts@5.4.1"></script>
<script src="https://cdn.jsdelivr.net/npm/vue-echarts@6.5.2"></script>
<script src="https://cdn.jsdelivr.net/npm/vue-echarts@6.5.3"></script>
```
<!-- vue2Scripts:end -->

View File

@ -1,6 +1,6 @@
{
"name": "vue-echarts",
"version": "6.5.2",
"version": "6.5.3",
"description": "Vue.js component for Apache ECharts.",
"author": "GU Yiling <justice360@gmail.com>",
"scripts": {

View File

@ -232,8 +232,11 @@ export default defineComponent({
if (!chart.value) {
init();
} else {
console.log(`notMerge: ${option !== oldOption}`);
chart.value.setOption(option, {
notMerge: option.value !== oldOption?.value,
// mutating `option` will lead to `notMerge: false` and
// replacing it with new reference will lead to `notMerge: true`
notMerge: option !== oldOption,
...realUpdateOptions.value
});
}