Compare commits

..

14 Commits
v8.0.1 ... main

Author SHA1 Message Date
712b4219f1 chore(deps): update dependency node to v24 (#934)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-11-04 14:04:10 +08:00
ad2b40d750 chore(deps): update patches after 7 days (#933)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-11-04 05:55:46 +00:00
c2235a0084 chore(deps): update dependency @vueuse/core to v14 (#932)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-11-03 10:58:20 +08:00
b44de6fc11 chore(deps): update actions/setup-node action to v6 (#931)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-11-03 10:56:46 +08:00
b906cadca1 chore(deps): update patches after 7 days (#929) 2025-11-03 09:12:25 +08:00
fb76fb6762 chore(deps): update pnpm to v10.19.0 (#930) 2025-11-03 09:11:59 +08:00
d3703840b0 chore(deps): update minors after 7 days (#927)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-10-27 14:48:09 +08:00
7b9e467c6b chore(deps): update patches after 7 days (#926)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-10-27 05:59:34 +00:00
1b0ab9b319 docs: update renovate configuration 2025-10-23 15:10:20 +08:00
dc0da13c1d chore: add continuous releases (#924) 2025-10-14 19:49:33 +08:00
0687dbf892 docs: fix badge links in README section headings to point to anchors instead of images (#923)
Co-authored-by: Yue JIN <yue.jin@konghq.com>
2025-10-14 18:01:44 +08:00
ca8dda363d docs: remove codegen image height, open details 2025-10-13 00:59:44 +08:00
842e013663 docs: align badge images in on-demand importing and slots sections 2025-10-13 00:07:12 +08:00
ad0e17ad9e docs: new images for code generator 2025-10-12 23:29:31 +08:00
9 changed files with 632 additions and 448 deletions

View File

@ -20,9 +20,9 @@ jobs:
uses: pnpm/action-setup@v4
- name: Install Node.js
uses: actions/setup-node@v5
uses: actions/setup-node@v6
with:
node-version: 22
node-version: 24
cache: pnpm
- name: Install dependencies
@ -53,3 +53,6 @@ jobs:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage/browser/lcov.info
disable_search: true
- name: Publish the commit
run: pnpm dlx pkg-pr-new publish --compact

View File

@ -22,9 +22,9 @@ jobs:
uses: pnpm/action-setup@v4
- name: Install Node.js
uses: actions/setup-node@v5
uses: actions/setup-node@v6
with:
node-version: 22
node-version: 24
cache: pnpm
- name: Install dependencies

View File

@ -6,7 +6,7 @@
> Still using Vue 2? Read v7 docs [here →](https://github.com/ecomfe/vue-echarts/tree/7.x)
## Installation & Usage
## Installation & usage
### npm
@ -16,7 +16,7 @@ npm install echarts vue-echarts
#### Example
<details>
<details open>
<summary><a href="https://stackblitz.com/edit/vue-echarts-8?file=src%2FApp.vue">Demo →</a></summary>
```vue
@ -94,12 +94,17 @@ const option = ref({
</details>
> [!IMPORTANT]
> 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.
>
> ![](https://github.com/ecomfe/vue-echarts/assets/1726061/f9c38a06-3422-4f0e-ab8c-f242d9aea9aa)
>
> [Try it →](https://vue-echarts.dev/#codegen)
#### On-demand importing&nbsp;<sup><a href="#on-demand-importing"><img src="https://img.shields.io/badge/recommended-10B981" alt="recommended" align="middle" height="16"></a></sup>
To keep your bundle size small, we recommend manually importing the components and charts you need from ECharts. To make this easier, weve created an [import code generator](https://vue-echarts.dev/#codegen). Simply paste your `option` code into the tool, and it will generate the exact import statements for you.
<picture>
<source media="(prefers-color-scheme: dark)" srcset="assets/codegen-dark.webp">
<source media="(prefers-color-scheme: light)" srcset="assets/codegen-light.webp">
<img alt="A modal for generating ECharts import code. The left panel shows a chart configuration in JSON, while the right panel displays TypeScript import statements for ECharts charts and components." src="assets/codegen-light.webp">
</picture>
[Try it →](https://vue-echarts.dev/#codegen)
But if you really want to import the whole ECharts bundle without having to import modules manually, just add this in your code:
@ -153,7 +158,8 @@ See more examples [here](https://github.com/ecomfe/vue-echarts/tree/main/demo).
ECharts' universal interface. Modifying this prop triggers Vue ECharts to compute an update plan and call `setOption`. Read more [here →](https://echarts.apache.org/en/option.html)
#### Smart Update
#### Smart update
- If you supply `update-options` (via prop or injection), Vue ECharts forwards it directly to `setOption` and skips the planner.
- Manual `setOption` calls (only available when `manual-update` is `true`) behave like native ECharts, honouring only the per-call override you pass in and are not carried across re-initializations.
- Otherwise, Vue ECharts analyses the change: removed objects become `null`, removed arrays become `[]` with `replaceMerge`, ID/anonymous deletions trigger `replaceMerge`, and risky changes fall back to `notMerge: true`.
@ -247,7 +253,7 @@ Vue ECharts support the following events:
See supported events in the [ECharts API reference →](https://echarts.apache.org/en/api.html#events)
#### Native DOM Events
#### Native DOM events
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.
@ -257,7 +263,7 @@ As Vue ECharts binds events to the ECharts instance by default, there is some ca
</template>
```
### Provide / Inject
### Provide / inject
Vue ECharts provides provide/inject API for `theme`, `init-options`, `update-options` and `loading-options` to help configuring contextual options. eg. for `theme` you can use the provide API like this:
@ -335,11 +341,11 @@ export default {
> - [`showLoading`](https://echarts.apache.org/en/api.html#echartsInstance.showLoading) / [`hideLoading`](https://echarts.apache.org/en/api.html#echartsInstance.hideLoading): use the `loading` and `loading-options` props instead.
> - [`setTheme`](https://echarts.apache.org/en/api.html#echartsInstance.setTheme): use the `theme` prop instead.
### Slots
### Slots&nbsp;<sup><a href="#slots"><img src="https://img.shields.io/badge/new-A855F7" alt="new" align="middle" height="16"></a></sup>
Vue ECharts allows you to define ECharts option's [`tooltip.formatter`](https://echarts.apache.org/en/option.html#tooltip.formatter) and [`toolbox.feature.dataView.optionToContent`](https://echarts.apache.org/en/option.html#toolbox.feature.dataView.optionToContent) callbacks via Vue slots instead of defining them in your `option` object. This simplifies custom HTMLElement rendering using familiar Vue templating.
#### Slot Naming Convention
#### Slot naming convention
- Slot names begin with `tooltip`/`dataView`, followed by hyphen-separated path segments to the target.
- Each segment corresponds to an `option` property name or an array index (for arrays, use the numeric index).
@ -405,7 +411,7 @@ The slot props correspond to the first parameter of the callback function.
> [!NOTE]
> Slots take precedence over the corresponding callback defined in `props.option`.
### Static Methods
### Static methods
Static methods can be accessed from [`echarts` itself](https://echarts.apache.org/en/api.html#echarts).

View File

@ -16,7 +16,7 @@ npm install echarts vue-echarts
#### 示例
<details>
<details open>
<summary><a href="https://stackblitz.com/edit/vue-echarts-8?file=src%2FApp.vue">Demo →</a></summary>
```vue
@ -94,12 +94,17 @@ const option = ref({
</details>
> [!IMPORTANT]
> 我们鼓励手动从 ECharts 中引入组件和图表,以减小打包体积。我们已经为此构建了一个[导入代码生成器](https://vue-echarts.dev/#codegen)。你只需要把`option` 代码粘贴进去,就可以得到精确的导入代码。
>
> ![](https://github.com/ecomfe/vue-echarts/assets/1726061/f9c38a06-3422-4f0e-ab8c-f242d9aea9aa)
>
> [试一试 →](https://vue-echarts.dev/#codegen)
#### 按需导入&nbsp;<sup><a href="#按需导入"><img src="https://img.shields.io/badge/%E6%8E%A8%E8%8D%90-10B981" alt="推荐" align="middle" height="16"></a></sup>
为了减小打包体积,我们建议手动从 ECharts 中导入所需的组件和图表。我们提供了一个[导入代码生成器](https://vue-echarts.dev/#codegen),可以帮你自动生成导入语句。只需将你的 `option` 代码粘贴进去,工具就会为你生成精确的导入代码。
<picture>
<source media="(prefers-color-scheme: dark)" srcset="assets/codegen-dark.webp">
<source media="(prefers-color-scheme: light)" srcset="assets/codegen-light.webp">
<img alt="一个用于生成 ECharts 导入代码的弹窗。左侧面板展示图表的 JSON 配置,右侧面板展示对应的 TypeScript 导入语句。" src="assets/codegen-light.webp">
</picture>
[试一试 →](https://vue-echarts.dev/#codegen)
但如果你实在需要全量引入 ECharts 从而无需手动引入模块,只需要在代码中添加:
@ -335,7 +340,7 @@ export default {
> - [`showLoading`](https://echarts.apache.org/zh/api.html#echartsInstance.showLoading) / [`hideLoading`](https://echarts.apache.org/zh/api.html#echartsInstance.hideLoading):请使用 `loading` 和 `loading-options` prop。
> - [`setTheme`](https://echarts.apache.org/zh/api.html#echartsInstance.setTheme):请使用 `theme` prop。
### 插槽Slots
### 插槽&nbsp;<sup><a href="#插槽"><img src="https://img.shields.io/badge/%E6%96%B0%E5%8A%9F%E8%83%BD-A855F7" alt="新功能" align="middle" height="16"></a></sup>
Vue ECharts 允许你通过 Vue 插槽来定义 ECharts 配置中的 [`tooltip.formatter`](https://echarts.apache.org/zh/option.html#tooltip.formatter) 和 [`toolbox.feature.dataView.optionToContent`](https://echarts.apache.org/zh/option.html#toolbox.feature.dataView.optionToContent) 回调,而无需在 `option` 对象中定义它们。你可以使用熟悉的 Vue 模板语法来编写自定义提示框或数据视图中的内容。

BIN
assets/codegen-dark.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 139 KiB

BIN
assets/codegen-light.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 162 KiB

View File

@ -26,7 +26,7 @@
"test:coverage": "vitest run --coverage",
"test:watch": "vitest watch"
},
"packageManager": "pnpm@10.18.0",
"packageManager": "pnpm@10.19.0",
"type": "module",
"main": "dist/index.js",
"unpkg": "dist/index.min.js",
@ -44,7 +44,7 @@
"vue": "^3.3.0"
},
"devDependencies": {
"@types/node": "^22.17.1",
"@types/node": "^24.0.0",
"@typescript-eslint/utils": "^8.39.1",
"@vercel/analytics": "^1.5.0",
"@vitejs/plugin-vue": "^6.0.1",
@ -53,7 +53,7 @@
"@vue/eslint-config-prettier": "^10.2.0",
"@vue/eslint-config-typescript": "^14.6.0",
"@vue/tsconfig": "^0.8.0",
"@vueuse/core": "^13.6.0",
"@vueuse/core": "^14.0.0",
"bumpp": "^10.2.3",
"comment-mark": "^2.0.1",
"echarts": "^6.0.0",
@ -61,7 +61,7 @@
"eslint": "^9.33.0",
"eslint-plugin-vue": "^10.4.0",
"jiti": "^2.5.1",
"monaco-editor": "^0.53.0",
"monaco-editor": "^0.54.0",
"pinia": "^3.0.3",
"playwright": "^1.55.0",
"postcss-nested": "^7.0.2",

1002
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@ -1,8 +1,6 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": ["config:recommended"],
"timezone": "Asia/Shanghai",
"schedule": ["* 8 * * 1"],
"extends": ["config:recommended", "schedule:weekly"],
"minimumReleaseAge": "7 days",
"internalChecksFilter": "strict",
"packageRules": [