mirror of
https://github.com/ecomfe/vue-echarts.git
synced 2025-08-14 19:23:28 +08:00
chore: refine issue form and readme
This commit is contained in:
2
.github/ISSUE_TEMPLATE/bug-report.en-US.yml
vendored
2
.github/ISSUE_TEMPLATE/bug-report.en-US.yml
vendored
@ -40,6 +40,6 @@ body:
|
|||||||
id: repro
|
id: repro
|
||||||
attributes:
|
attributes:
|
||||||
label: Reproduction
|
label: Reproduction
|
||||||
description: "A link to a boiled-down reproduction (a minimal but runnable demo with unnecessary dependencies pruned). Please paste the link to your CodeSandbox demo below: ([Vue 3 template](https://codesandbox.io/s/charming-night-2y6m6?file=/src/App.vue) / [Vue 2 template](https://codesandbox.io/s/suspicious-glitter-mk66j?file=/src/App.vue))"
|
description: "A link to a boiled-down reproduction (a minimal but runnable demo with unnecessary dependencies pruned). If the issue isn't reproducible within an online playground, please create a GitHub repo to reflect the problem. Please paste the link to your CodeSandbox demo or GitHub repo below: ([Vue 3 template](https://codesandbox.io/s/charming-night-2y6m6?file=/src/App.vue) / [Vue 2 template](https://codesandbox.io/s/suspicious-glitter-mk66j?file=/src/App.vue))"
|
||||||
validations:
|
validations:
|
||||||
required: true
|
required: true
|
||||||
|
@ -40,6 +40,6 @@ body:
|
|||||||
id: repro
|
id: repro
|
||||||
attributes:
|
attributes:
|
||||||
label: 问题复现
|
label: 问题复现
|
||||||
description: "请提供一个精炼的问题复现(去除无关依赖的最小化可运行 demo)。 Plea请在下方贴入在 CodeSandbox 上 demo 的链接:([Vue 3 模板](https://codesandbox.io/s/charming-night-2y6m6?file=/src/App.vue) / [Vue 2 模板](https://codesandbox.io/s/suspicious-glitter-mk66j?file=/src/App.vue))"
|
description: "请提供一个精炼的问题复现(去除无关依赖的最小化可运行 demo)。如果在线环境无法复现,可以创建对应的 GitHub repo 来提供复现环境。请在下方贴入在 CodeSandbox 上 demo 的链接或 GitHub repo 链接:([Vue 3 模板](https://codesandbox.io/s/charming-night-2y6m6?file=/src/App.vue) / [Vue 2 模板](https://codesandbox.io/s/suspicious-glitter-mk66j?file=/src/App.vue))"
|
||||||
validations:
|
validations:
|
||||||
required: true
|
required: true
|
||||||
|
18
README.md
18
README.md
@ -20,13 +20,21 @@ Not ready yet? Read documentation for older versions [here →](https://github.c
|
|||||||
$ npm install echarts vue-echarts
|
$ npm install echarts vue-echarts
|
||||||
```
|
```
|
||||||
|
|
||||||
To make `vue-echarts` work for Vue 2, you need to have `@vue/composition-api` installed:
|
To make `vue-echarts` work for *Vue 2*, you need to have `@vue/composition-api` installed:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
npm i -D @vue/composition-api
|
npm i -D @vue/composition-api
|
||||||
```
|
```
|
||||||
|
|
||||||
<details open>
|
If you are using *NuxtJS* on top of *Vue 2*, you'll also need `@nuxtjs/composition-api`:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
npm i -D @nuxtjs/composition-api
|
||||||
|
```
|
||||||
|
|
||||||
|
And then add `'@nuxtjs/composition-api/module'` in the `buildModules` option in your `nuxt.config.js`.
|
||||||
|
|
||||||
|
<details>
|
||||||
<summary>Vue 3</summary>
|
<summary>Vue 3</summary>
|
||||||
|
|
||||||
```js
|
```js
|
||||||
@ -108,7 +116,7 @@ import "echarts";
|
|||||||
|
|
||||||
#### SFC example
|
#### SFC example
|
||||||
|
|
||||||
<details open>
|
<details>
|
||||||
<summary>Vue 3</summary>
|
<summary>Vue 3</summary>
|
||||||
|
|
||||||
```vue
|
```vue
|
||||||
@ -299,7 +307,7 @@ export default {
|
|||||||
|
|
||||||
Drop `<script>` inside your HTML file and access the component via `window.VueECharts`.
|
Drop `<script>` inside your HTML file and access the component via `window.VueECharts`.
|
||||||
|
|
||||||
<details open>
|
<details>
|
||||||
<summary>Vue 3</summary>
|
<summary>Vue 3</summary>
|
||||||
|
|
||||||
<!-- vue3Scripts:start -->
|
<!-- vue3Scripts:start -->
|
||||||
@ -402,7 +410,7 @@ See more examples [here](https://github.com/ecomfe/vue-echarts/tree/main/src/dem
|
|||||||
|
|
||||||
Vue-ECharts provides provide/inject API for `theme`, `init-options`, `update-options` and `loading-options` to help configuring contextual options. eg. for `init-options` you can use the provide API like this:
|
Vue-ECharts provides provide/inject API for `theme`, `init-options`, `update-options` and `loading-options` to help configuring contextual options. eg. for `init-options` you can use the provide API like this:
|
||||||
|
|
||||||
<details open>
|
<details>
|
||||||
<summary>Vue 3</summary>
|
<summary>Vue 3</summary>
|
||||||
|
|
||||||
```js
|
```js
|
||||||
|
@ -18,13 +18,21 @@
|
|||||||
$ npm install echarts vue-echarts
|
$ npm install echarts vue-echarts
|
||||||
```
|
```
|
||||||
|
|
||||||
要在 Vue 2 下使用 `vue-echarts`,需要确保 `@vue/composition-api` 已经安装:
|
要在 *Vue 2* 下使用 `vue-echarts`,需要确保 `@vue/composition-api` 已经安装:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
npm i -D @vue/composition-api
|
npm i -D @vue/composition-api
|
||||||
```
|
```
|
||||||
|
|
||||||
<details open>
|
如果你在使用基于 *Vue 2* 的 *NuxtJS*,那么还需要安装 `@nuxtjs/composition-api`:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
npm i -D @nuxtjs/composition-api
|
||||||
|
```
|
||||||
|
|
||||||
|
然后在 `nuxt.config.js` 的 `buildModules` 选项中添加 `'@nuxtjs/composition-api/module'`。
|
||||||
|
|
||||||
|
<details>
|
||||||
<summary>Vue 3</summary>
|
<summary>Vue 3</summary>
|
||||||
|
|
||||||
```js
|
```js
|
||||||
@ -106,7 +114,7 @@ import "echarts";
|
|||||||
|
|
||||||
#### 单文件组件示例
|
#### 单文件组件示例
|
||||||
|
|
||||||
<details open>
|
<details>
|
||||||
<summary>Vue 3</summary>
|
<summary>Vue 3</summary>
|
||||||
|
|
||||||
```vue
|
```vue
|
||||||
@ -293,7 +301,7 @@ export default {
|
|||||||
|
|
||||||
用如下方式在 HTML 中插入 `<script>` 标签,并且通过 `window.VueECharts` 来访问组件接口:
|
用如下方式在 HTML 中插入 `<script>` 标签,并且通过 `window.VueECharts` 来访问组件接口:
|
||||||
|
|
||||||
<details open>
|
<details>
|
||||||
<summary>Vue 3</summary>
|
<summary>Vue 3</summary>
|
||||||
|
|
||||||
<!-- vue3Scripts:start -->
|
<!-- vue3Scripts:start -->
|
||||||
@ -392,7 +400,7 @@ Vue.component("v-chart", VueECharts);
|
|||||||
|
|
||||||
Vue-ECharts 为 `theme`、`init-options`、`update-options` 和 `loading-options` 提供了 provide/inject API,以通过上下文配置选项。例如:可以通过如下方式来使用 provide API 为 `init-options` 提供上下文配置:
|
Vue-ECharts 为 `theme`、`init-options`、`update-options` 和 `loading-options` 提供了 provide/inject API,以通过上下文配置选项。例如:可以通过如下方式来使用 provide API 为 `init-options` 提供上下文配置:
|
||||||
|
|
||||||
<details open>
|
<details>
|
||||||
<summary>Vue 3</summary>
|
<summary>Vue 3</summary>
|
||||||
|
|
||||||
```js
|
```js
|
||||||
|
Reference in New Issue
Block a user