docs: update examples in readme (#524)

This commit is contained in:
565871779
2021-03-11 14:55:46 +08:00
committed by GitHub
parent e10e588d99
commit accab93ea1
2 changed files with 34 additions and 2 deletions

View File

@ -32,6 +32,7 @@ npm i -D @vue/composition-api
```js
import { createApp } from 'vue'
import ECharts from 'vue-echarts'
import { use } from "echarts/core"
// import ECharts modules manually to reduce bundle size
import {
@ -45,6 +46,13 @@ import {
TooltipComponent
} from 'echarts/components'
use([
CanvasRenderer,
BarChart,
GridComponent,
TooltipComponent
])
const app = createApp(...)
// register globally (or you can do it locally)
@ -61,8 +69,9 @@ app.mount(...)
```js
import Vue from 'vue'
import ECharts from 'vue-echarts'
import { use } from 'echarts/core'
// import ECharts modules manually to reduce bundle size
import {
CanvasRenderer
} from 'echarts/renderers'
@ -74,6 +83,13 @@ import {
TooltipComponent
} from 'echarts/components'
use([
CanvasRenderer,
BarChart,
GridComponent,
TooltipComponent
]);
// register globally (or you can do it locally)
Vue.component('v-chart', ECharts)