Skip to content

Commit 349644f

Browse files
kingyue737Justineo
authored andcommitted
docs: remove vue 2 related content
1 parent 503094d commit 349644f

File tree

3 files changed

+4
-264
lines changed

3 files changed

+4
-264
lines changed

README.md

Lines changed: 1 addition & 131 deletions
Original file line numberDiff line numberDiff line change
@@ -96,100 +96,6 @@ const option = ref({
9696

9797
</details>
9898

99-
<details>
100-
<summary>Vue 2 <a href="https://stackblitz.com/edit/vue-echarts-vue-2?file=src%2FApp.vue">Demo →</a></summary>
101-
102-
```vue
103-
<template>
104-
<v-chart class="chart" :option="option" />
105-
</template>
106-
107-
<script>
108-
import { use } from "echarts/core";
109-
import { CanvasRenderer } from "echarts/renderers";
110-
import { PieChart } from "echarts/charts";
111-
import {
112-
TitleComponent,
113-
TooltipComponent,
114-
LegendComponent
115-
} from "echarts/components";
116-
import VChart, { THEME_KEY } from "vue-echarts";
117-
118-
use([
119-
CanvasRenderer,
120-
PieChart,
121-
TitleComponent,
122-
TooltipComponent,
123-
LegendComponent
124-
]);
125-
126-
export default {
127-
name: "HelloWorld",
128-
components: {
129-
VChart
130-
},
131-
provide: {
132-
[THEME_KEY]: "dark"
133-
},
134-
data() {
135-
return {
136-
option: {
137-
title: {
138-
text: "Traffic Sources",
139-
left: "center"
140-
},
141-
tooltip: {
142-
trigger: "item",
143-
formatter: "{a} <br/>{b} : {c} ({d}%)"
144-
},
145-
legend: {
146-
orient: "vertical",
147-
left: "left",
148-
data: [
149-
"Direct",
150-
"Email",
151-
"Ad Networks",
152-
"Video Ads",
153-
"Search Engines"
154-
]
155-
},
156-
series: [
157-
{
158-
name: "Traffic Sources",
159-
type: "pie",
160-
radius: "55%",
161-
center: ["50%", "60%"],
162-
data: [
163-
{ value: 335, name: "Direct" },
164-
{ value: 310, name: "Email" },
165-
{ value: 234, name: "Ad Networks" },
166-
{ value: 135, name: "Video Ads" },
167-
{ value: 1548, name: "Search Engines" }
168-
],
169-
emphasis: {
170-
itemStyle: {
171-
shadowBlur: 10,
172-
shadowOffsetX: 0,
173-
shadowColor: "rgba(0, 0, 0, 0.5)"
174-
}
175-
}
176-
}
177-
]
178-
}
179-
};
180-
}
181-
};
182-
</script>
183-
184-
<style scoped>
185-
.chart {
186-
height: 400px;
187-
}
188-
</style>
189-
```
190-
191-
</details>
192-
19399
> [!IMPORTANT]
194100
> We encourage manually importing components and charts from ECharts for smaller bundle size. We've built an [import code generator](https://vue-echarts.dev/#codegen) to help you with that. You can just paste in your `option` code and we'll generate the precise import code for you.
195101
>
@@ -341,7 +247,7 @@ See supported events [here →](https://echarts.apache.org/en/api.html#events)
341247

342248
#### Native DOM Events
343249

344-
As Vue-ECharts binds events to the ECharts instance by default, there is some caveat when using native DOM events. You need to prefix the event name with `native:` to bind native DOM events (or you can use the `.native` modifier in Vue 2, which is dropped in Vue 3).
250+
As Vue-ECharts binds events to the ECharts instance by default, there is some caveat when using native DOM events. You need to prefix the event name with `native:` to bind native DOM events.
345251

346252
```vue
347253
<template>
@@ -373,42 +279,6 @@ provide(THEME_KEY, 'dark')
373279

374280
</details>
375281

376-
<details>
377-
<summary>Vue 2</summary>
378-
379-
```js
380-
import { THEME_KEY } from 'vue-echarts'
381-
382-
// in component options
383-
{
384-
provide: {
385-
[THEME_KEY]: 'dark'
386-
}
387-
}
388-
```
389-
390-
> **Note**
391-
>
392-
> You need to provide an object for Vue 2 if you want to change it dynamically.
393-
>
394-
> ```js
395-
> // in component options
396-
> {
397-
> data () {
398-
> return {
399-
> theme: { value: 'dark' }
400-
> }
401-
> },
402-
> provide () {
403-
> return {
404-
> [THEME_KEY]: this.theme
405-
> }
406-
> }
407-
> }
408-
> ```
409-
410-
</details>
411-
412282
### Methods
413283

414284
- `setOption` [](https://echarts.apache.org/en/api.html#echartsInstance.setOption)

README.zh-Hans.md

Lines changed: 1 addition & 131 deletions
Original file line numberDiff line numberDiff line change
@@ -96,100 +96,6 @@ const option = ref({
9696

9797
</details>
9898

99-
<details>
100-
<summary>Vue 2 <a href="https://stackblitz.com/edit/vue-echarts-vue-2?file=src%2FApp.vue">Demo →</a></summary>
101-
102-
```vue
103-
<template>
104-
<v-chart class="chart" :option="option" />
105-
</template>
106-
107-
<script>
108-
import { use } from "echarts/core";
109-
import { CanvasRenderer } from "echarts/renderers";
110-
import { PieChart } from "echarts/charts";
111-
import {
112-
TitleComponent,
113-
TooltipComponent,
114-
LegendComponent
115-
} from "echarts/components";
116-
import VChart, { THEME_KEY } from "vue-echarts";
117-
118-
use([
119-
CanvasRenderer,
120-
PieChart,
121-
TitleComponent,
122-
TooltipComponent,
123-
LegendComponent
124-
]);
125-
126-
export default {
127-
name: "HelloWorld",
128-
components: {
129-
VChart
130-
},
131-
provide: {
132-
[THEME_KEY]: "dark"
133-
},
134-
data() {
135-
return {
136-
option: {
137-
title: {
138-
text: "Traffic Sources",
139-
left: "center"
140-
},
141-
tooltip: {
142-
trigger: "item",
143-
formatter: "{a} <br/>{b} : {c} ({d}%)"
144-
},
145-
legend: {
146-
orient: "vertical",
147-
left: "left",
148-
data: [
149-
"Direct",
150-
"Email",
151-
"Ad Networks",
152-
"Video Ads",
153-
"Search Engines"
154-
]
155-
},
156-
series: [
157-
{
158-
name: "Traffic Sources",
159-
type: "pie",
160-
radius: "55%",
161-
center: ["50%", "60%"],
162-
data: [
163-
{ value: 335, name: "Direct" },
164-
{ value: 310, name: "Email" },
165-
{ value: 234, name: "Ad Networks" },
166-
{ value: 135, name: "Video Ads" },
167-
{ value: 1548, name: "Search Engines" }
168-
],
169-
emphasis: {
170-
itemStyle: {
171-
shadowBlur: 10,
172-
shadowOffsetX: 0,
173-
shadowColor: "rgba(0, 0, 0, 0.5)"
174-
}
175-
}
176-
}
177-
]
178-
}
179-
};
180-
}
181-
};
182-
</script>
183-
184-
<style scoped>
185-
.chart {
186-
height: 400px;
187-
}
188-
</style>
189-
```
190-
191-
</details>
192-
19399
> [!IMPORTANT]
194100
> 我们鼓励手动从 ECharts 中引入组件和图表,以减小打包体积。我们已经为此构建了一个[导入代码生成器](https://vue-echarts.dev/#codegen)。你只需要把`option` 代码粘贴进去,就可以得到精确的导入代码。
195101
>
@@ -341,7 +247,7 @@ Vue-ECharts 支持如下事件:
341247

342248
#### 原生 DOM 事件
343249

344-
由于 Vue-ECharts 默认将事件绑定到 ECharts 实例,因此在使用原生 DOM 事件时需要做一些特殊处理。你需要在事件名称前加上 `native:` 前缀来绑定原生 DOM 事件(在 Vue 2 中也可以使用 `.native` 修饰符,但这在 Vue 3 中已被废弃)
250+
由于 Vue-ECharts 默认将事件绑定到 ECharts 实例,因此在使用原生 DOM 事件时需要做一些特殊处理。你需要在事件名称前加上 `native:` 前缀来绑定原生 DOM 事件。
345251

346252
```vue
347253
<template>
@@ -373,42 +279,6 @@ provide(THEME_KEY, 'dark')
373279

374280
</details>
375281

376-
<details>
377-
<summary>Vue 2</summary>
378-
379-
```js
380-
import { THEME_KEY } from 'vue-echarts'
381-
382-
// 组件选项中
383-
{
384-
provide: {
385-
[THEME_KEY]: 'dark'
386-
}
387-
}
388-
```
389-
390-
> **Note**
391-
>
392-
> 在 Vue 2 中,如果你想动态地改变这些选项,那么你需要提供一个对象。
393-
>
394-
> ```js
395-
> // 组件选项中
396-
> {
397-
> data () {
398-
> return {
399-
> theme: { value: 'dark' }
400-
> }
401-
> },
402-
> provide () {
403-
> return {
404-
> [THEME_KEY]: this.theme
405-
> }
406-
> }
407-
> }
408-
> ```
409-
410-
</details>
411-
412282
### 方法
413283

414284
- `setOption` [](https://echarts.apache.org/zh/api.html#echartsInstance.setOption)

scripts/docs.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ const { name, version } = getPackageMeta();
77
const CDN_PREFIX = "https://cdn.jsdelivr.net/npm/";
88

99
const DEP_VERSIONS = {
10-
"vue@3": "3.5.13",
10+
vue: "3.5.13",
1111
echarts: "5.5.1",
1212
[name]: version
1313
};
1414

1515
function getScripts() {
16-
const deps = ["vue@3", "echarts", name];
16+
const deps = ["vue", "echarts", name];
1717
return deps
1818
.map(dep => {
1919
const [, name] = dep.match(/^(.+?)(?:@.+)?$/) || [];

0 commit comments

Comments
 (0)