Compare commits

..

1 Commits
7.x ... v7.0.2

Author SHA1 Message Date
f56b83a8d6 fix(#805): fix style injection 2024-08-13 15:12:09 +08:00
8 changed files with 32 additions and 42 deletions

View File

@ -1,10 +1,6 @@
## 7.0.3
* Fixed type for `autoresize` (again).
## 7.0.2 ## 7.0.2
* Fixed style injection regression (#805). * Fixed style injection regression.
## 7.0.1 ## 7.0.1

View File

@ -214,7 +214,7 @@ Drop `<script>` inside your HTML file and access the component via `window.VueEC
```html ```html
<script src="https://cdn.jsdelivr.net/npm/vue@3.4.33"></script> <script src="https://cdn.jsdelivr.net/npm/vue@3.4.33"></script>
<script src="https://cdn.jsdelivr.net/npm/echarts@5.5.1"></script> <script src="https://cdn.jsdelivr.net/npm/echarts@5.5.1"></script>
<script src="https://cdn.jsdelivr.net/npm/vue-echarts@7.0.3"></script> <script src="https://cdn.jsdelivr.net/npm/vue-echarts@7.0.2"></script>
``` ```
<!-- vue3Scripts:end --> <!-- vue3Scripts:end -->
@ -234,7 +234,7 @@ app.component('v-chart', VueECharts)
```html ```html
<script src="https://cdn.jsdelivr.net/npm/vue@2.7.16"></script> <script src="https://cdn.jsdelivr.net/npm/vue@2.7.16"></script>
<script src="https://cdn.jsdelivr.net/npm/echarts@5.5.1"></script> <script src="https://cdn.jsdelivr.net/npm/echarts@5.5.1"></script>
<script src="https://cdn.jsdelivr.net/npm/vue-echarts@7.0.3"></script> <script src="https://cdn.jsdelivr.net/npm/vue-echarts@7.0.2"></script>
``` ```
<!-- vue2Scripts:end --> <!-- vue2Scripts:end -->
@ -439,14 +439,13 @@ import { THEME_KEY } from 'vue-echarts'
- `convertToPixel` [](https://echarts.apache.org/en/api.html#echartsInstance.convertToPixel) - `convertToPixel` [](https://echarts.apache.org/en/api.html#echartsInstance.convertToPixel)
- `convertFromPixel` [](https://echarts.apache.org/en/api.html#echartsInstance.convertFromPixel) - `convertFromPixel` [](https://echarts.apache.org/en/api.html#echartsInstance.convertFromPixel)
- `containPixel` [](https://echarts.apache.org/en/api.html#echartsInstance.containPixel) - `containPixel` [](https://echarts.apache.org/en/api.html#echartsInstance.containPixel)
- `showLoading` [](https://echarts.apache.org/en/api.html#echartsInstance.showLoading)
- `hideLoading` [](https://echarts.apache.org/en/api.html#echartsInstance.hideLoading)
- `getDataURL` [](https://echarts.apache.org/en/api.html#echartsInstance.getDataURL) - `getDataURL` [](https://echarts.apache.org/en/api.html#echartsInstance.getDataURL)
- `getConnectedDataURL` [](https://echarts.apache.org/en/api.html#echartsInstance.getConnectedDataURL) - `getConnectedDataURL` [](https://echarts.apache.org/en/api.html#echartsInstance.getConnectedDataURL)
- `clear` [](https://echarts.apache.org/en/api.html#echartsInstance.clear) - `clear` [](https://echarts.apache.org/en/api.html#echartsInstance.clear)
- `dispose` [](https://echarts.apache.org/en/api.html#echartsInstance.dispose) - `dispose` [](https://echarts.apache.org/en/api.html#echartsInstance.dispose)
> [!NOTE]
> [`showLoading`](https://echarts.apache.org/en/api.html#echartsInstance.showLoading) and [`hideLoading`](https://echarts.apache.org/en/api.html#echartsInstance.hideLoading) are not exposed. Use the **`loading`** and **`loading-options`** props.
### Static Methods ### Static Methods
Static methods can be accessed from [`echarts` itself](https://echarts.apache.org/en/api.html#echarts). Static methods can be accessed from [`echarts` itself](https://echarts.apache.org/en/api.html#echarts).

View File

@ -6,7 +6,7 @@
--- ---
> 还在使用 v6可以继续阅读老版本的文档。[前往 →](https://github.com/ecomfe/vue-echarts/blob/6.x/README.zh-Hans.md) > 还在使用 v6可以继续阅读老版本的文档。[前往 →](https://github.com/ecomfe/vue-echarts/blob/6.x/README.zh_CN.md)
## 安装 & 使用 ## 安装 & 使用
@ -214,7 +214,7 @@ import "echarts";
```html ```html
<script src="https://cdn.jsdelivr.net/npm/vue@3.4.33"></script> <script src="https://cdn.jsdelivr.net/npm/vue@3.4.33"></script>
<script src="https://cdn.jsdelivr.net/npm/echarts@5.5.1"></script> <script src="https://cdn.jsdelivr.net/npm/echarts@5.5.1"></script>
<script src="https://cdn.jsdelivr.net/npm/vue-echarts@7.0.3"></script> <script src="https://cdn.jsdelivr.net/npm/vue-echarts@7.0.2"></script>
``` ```
<!-- vue3Scripts:end --> <!-- vue3Scripts:end -->
@ -234,7 +234,7 @@ app.component('v-chart', VueECharts)
```html ```html
<script src="https://cdn.jsdelivr.net/npm/vue@2.7.16"></script> <script src="https://cdn.jsdelivr.net/npm/vue@2.7.16"></script>
<script src="https://cdn.jsdelivr.net/npm/echarts@5.5.1"></script> <script src="https://cdn.jsdelivr.net/npm/echarts@5.5.1"></script>
<script src="https://cdn.jsdelivr.net/npm/vue-echarts@7.0.3"></script> <script src="https://cdn.jsdelivr.net/npm/vue-echarts@7.0.2"></script>
``` ```
<!-- vue2Scripts:end --> <!-- vue2Scripts:end -->
@ -359,7 +359,7 @@ Vue-ECharts 支持如下事件:
#### 原生 DOM 事件 #### 原生 DOM 事件
由于 Vue-ECharts 默认将事件绑定到 ECharts 实例,因此在使用原生 DOM 事件时需要做一些特殊处理。你需要在事件名称前加上 `native:` 前缀来绑定原生 DOM 事件(在 Vue 2 中也可以使用 `.native` 修饰符,但这在 Vue 3 中已被废弃)。 由于 Vue-ECharts 默认将事件绑定到 ECharts 实例,因此在使用原生 DOM 事件时需要做一些特殊处理。你需要在事件名称前加上 `native:` 前缀来绑定原生 DOM 事件(可以在 Vue 2 中也可以使用 `.native` 修饰符,但这在 Vue 3 中已被废弃)。
```vue ```vue
<template> <template>
@ -439,14 +439,13 @@ import { THEME_KEY } from 'vue-echarts'
- `convertToPixel` [](https://echarts.apache.org/zh/api.html#echartsInstance.convertToPixel) - `convertToPixel` [](https://echarts.apache.org/zh/api.html#echartsInstance.convertToPixel)
- `convertFromPixel` [](https://echarts.apache.org/zh/api.html#echartsInstance.convertFromPixel) - `convertFromPixel` [](https://echarts.apache.org/zh/api.html#echartsInstance.convertFromPixel)
- `containPixel` [](https://echarts.apache.org/zh/api.html#echartsInstance.containPixel) - `containPixel` [](https://echarts.apache.org/zh/api.html#echartsInstance.containPixel)
- `showLoading` [](https://echarts.apache.org/zh/api.html#echartsInstance.showLoading)
- `hideLoading` [](https://echarts.apache.org/zh/api.html#echartsInstance.hideLoading)
- `getDataURL` [](https://echarts.apache.org/zh/api.html#echartsInstance.getDataURL) - `getDataURL` [](https://echarts.apache.org/zh/api.html#echartsInstance.getDataURL)
- `getConnectedDataURL` [](https://echarts.apache.org/zh/api.html#echartsInstance.getConnectedDataURL) - `getConnectedDataURL` [](https://echarts.apache.org/zh/api.html#echartsInstance.getConnectedDataURL)
- `clear` [](https://echarts.apache.org/zh/api.html#echartsInstance.clear) - `clear` [](https://echarts.apache.org/zh/api.html#echartsInstance.clear)
- `dispose` [](https://echarts.apache.org/zh/api.html#echartsInstance.dispose) - `dispose` [](https://echarts.apache.org/zh/api.html#echartsInstance.dispose)
> [!NOTE]
> [`showLoading`](https://echarts.apache.org/zh/api.html#echartsInstance.showLoading) 和 [`hideLoading`](https://echarts.apache.org/zh/api.html#echartsInstance.hideLoading) 未被暴露,请使用 **`loading`** 和 **`loading-options`** prop。
### 静态方法 ### 静态方法
静态方法请直接通过 [`echarts` 本身](https://echarts.apache.org/zh/api.html#echarts)进行调用。 静态方法请直接通过 [`echarts` 本身](https://echarts.apache.org/zh/api.html#echarts)进行调用。
@ -459,6 +458,9 @@ import { THEME_KEY } from 'vue-echarts'
## 迁移到 v7 ## 迁移到 v7
Translate:
Read the breaking changes document in the [release log](https://github.com/ecomfe/vue-echarts/releases/tag/v7.0.0-beta.0) and the migration shoud be straightforward.
请阅读[发布日志](https://github.com/ecomfe/vue-echarts/releases/tag/v7.0.0-beta.0)中的变更记录,之后迁移过程应该会相对简单。 请阅读[发布日志](https://github.com/ecomfe/vue-echarts/releases/tag/v7.0.0-beta.0)中的变更记录,之后迁移过程应该会相对简单。
## 本地开发 ## 本地开发

View File

@ -1,6 +1,6 @@
{ {
"name": "vue-echarts", "name": "vue-echarts",
"version": "7.0.3", "version": "7.0.2",
"description": "Vue.js component for Apache ECharts™.", "description": "Vue.js component for Apache ECharts™.",
"license": "MIT", "license": "MIT",
"repository": "https://github.com/ecomfe/vue-echarts.git", "repository": "https://github.com/ecomfe/vue-echarts.git",
@ -80,7 +80,7 @@
"rollup": "^4.19.0", "rollup": "^4.19.0",
"rollup-plugin-dts": "^6.1.0", "rollup-plugin-dts": "^6.1.0",
"rollup-plugin-esbuild": "^6.1.1", "rollup-plugin-esbuild": "^6.1.1",
"rollup-plugin-import-css": "^3.5.1", "@justfork/rollup-plugin-import-css": "^3.5.1",
"tslib": "^2.6.3", "tslib": "^2.6.3",
"typescript": "5.5.4", "typescript": "5.5.4",
"vue": "^3.4.33", "vue": "^3.4.33",

28
pnpm-lock.yaml generated
View File

@ -21,6 +21,9 @@ importers:
'@highlightjs/vue-plugin': '@highlightjs/vue-plugin':
specifier: ^2.1.0 specifier: ^2.1.0
version: 2.1.0(highlight.js@11.10.0)(vue@3.4.33(typescript@5.5.4)) version: 2.1.0(highlight.js@11.10.0)(vue@3.4.33(typescript@5.5.4))
'@justfork/rollup-plugin-import-css':
specifier: ^3.5.1
version: 3.5.1(rollup@4.19.0)
'@rollup/plugin-node-resolve': '@rollup/plugin-node-resolve':
specifier: ^15.2.3 specifier: ^15.2.3
version: 15.2.3(rollup@4.19.0) version: 15.2.3(rollup@4.19.0)
@ -126,9 +129,6 @@ importers:
rollup-plugin-esbuild: rollup-plugin-esbuild:
specifier: ^6.1.1 specifier: ^6.1.1
version: 6.1.1(esbuild@0.23.0)(rollup@4.19.0) version: 6.1.1(esbuild@0.23.0)(rollup@4.19.0)
rollup-plugin-import-css:
specifier: ^3.5.1
version: 3.5.1(rollup@4.19.0)
tslib: tslib:
specifier: ^2.6.3 specifier: ^2.6.3
version: 2.6.3 version: 2.6.3
@ -1069,6 +1069,12 @@ packages:
'@jridgewell/trace-mapping@0.3.25': '@jridgewell/trace-mapping@0.3.25':
resolution: {integrity: sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==} resolution: {integrity: sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==}
'@justfork/rollup-plugin-import-css@3.5.1':
resolution: {integrity: sha512-0ZKUAFk//Ki0m1IsuwGhd9WZa9yxsw+059GPIVqMbUPFO05a5V1LtmkV+EPxPAeWxjxSc0DPo7YZAulEoRLWsg==}
engines: {node: '>=16'}
peerDependencies:
rollup: ^2.x.x || ^3.x.x || ^4.x.x
'@leichtgewicht/ip-codec@2.0.5': '@leichtgewicht/ip-codec@2.0.5':
resolution: {integrity: sha512-Vo+PSpZG2/fmgmiNzYK9qWRh8h/CHrwD0mo1h1DzL4yzHNSfWYujGTYsWGreD000gcgmZ7K4Ys6Tx9TxtsKdDw==} resolution: {integrity: sha512-Vo+PSpZG2/fmgmiNzYK9qWRh8h/CHrwD0mo1h1DzL4yzHNSfWYujGTYsWGreD000gcgmZ7K4Ys6Tx9TxtsKdDw==}
@ -4070,12 +4076,6 @@ packages:
esbuild: '>=0.18.0' esbuild: '>=0.18.0'
rollup: ^1.20.0 || ^2.0.0 || ^3.0.0 || ^4.0.0 rollup: ^1.20.0 || ^2.0.0 || ^3.0.0 || ^4.0.0
rollup-plugin-import-css@3.5.1:
resolution: {integrity: sha512-cXgMPCUoDu64A2OFme4Is3eHmLiA54qTzxfvCbsORzro3C1adSe1fMMKUqfOUKTXROAPpW9PNDjpaGgPloGJOQ==}
engines: {node: '>=16'}
peerDependencies:
rollup: ^2.x.x || ^3.x.x || ^4.x.x
rollup@4.19.0: rollup@4.19.0:
resolution: {integrity: sha512-5r7EYSQIowHsK4eTZ0Y81qpZuJz+MUuYeqmmYmRMl1nwhdmbiYqt5jwzf6u7wyOzJgYqtCRMtVRKOtHANBz7rA==} resolution: {integrity: sha512-5r7EYSQIowHsK4eTZ0Y81qpZuJz+MUuYeqmmYmRMl1nwhdmbiYqt5jwzf6u7wyOzJgYqtCRMtVRKOtHANBz7rA==}
engines: {node: '>=18.0.0', npm: '>=8.0.0'} engines: {node: '>=18.0.0', npm: '>=8.0.0'}
@ -5796,6 +5796,11 @@ snapshots:
'@jridgewell/resolve-uri': 3.1.2 '@jridgewell/resolve-uri': 3.1.2
'@jridgewell/sourcemap-codec': 1.4.15 '@jridgewell/sourcemap-codec': 1.4.15
'@justfork/rollup-plugin-import-css@3.5.1(rollup@4.19.0)':
dependencies:
'@rollup/pluginutils': 5.1.0(rollup@4.19.0)
rollup: 4.19.0
'@leichtgewicht/ip-codec@2.0.5': {} '@leichtgewicht/ip-codec@2.0.5': {}
'@node-ipc/js-queue@2.0.3': '@node-ipc/js-queue@2.0.3':
@ -8983,11 +8988,6 @@ snapshots:
transitivePeerDependencies: transitivePeerDependencies:
- supports-color - supports-color
rollup-plugin-import-css@3.5.1(rollup@4.19.0):
dependencies:
'@rollup/pluginutils': 5.1.0(rollup@4.19.0)
rollup: 4.19.0
rollup@4.19.0: rollup@4.19.0:
dependencies: dependencies:
'@types/estree': 1.0.5 '@types/estree': 1.0.5

View File

@ -1,7 +1,7 @@
import replace from "@rollup/plugin-replace"; import replace from "@rollup/plugin-replace";
import esbuild from "rollup-plugin-esbuild"; import esbuild from "rollup-plugin-esbuild";
import { dts } from "rollup-plugin-dts"; import { dts } from "rollup-plugin-dts";
import css from "rollup-plugin-import-css"; import css from "@justfork/rollup-plugin-import-css";
import { injectVueDemi } from "./scripts/rollup.mjs"; import { injectVueDemi } from "./scripts/rollup.mjs";
/** /**

View File

@ -40,12 +40,6 @@ export function useAutoresize(
return; return;
} }
} }
// Skip if container has zero size
if (root.offsetWidth === 0 || root.offsetHeight === 0) {
return;
}
resizeCallback(); resizeCallback();
}); });
ro.observe(root); ro.observe(root);

3
src/index.d.ts vendored
View File

@ -6,7 +6,6 @@ import type {
InitOptions, InitOptions,
UpdateOptions, UpdateOptions,
LoadingOptions, LoadingOptions,
AutoResize,
EChartsType, EChartsType,
Emits, Emits,
ThemeInjection, ThemeInjection,
@ -26,7 +25,7 @@ declare type ChartProps = {
updateOptions?: UpdateOptions; updateOptions?: UpdateOptions;
loadingOptions?: LoadingOptions; loadingOptions?: LoadingOptions;
option?: Option; option?: Option;
autoresize?: AutoResize; autoresize?: boolean;
loading?: boolean; loading?: boolean;
group?: string; group?: string;
manualUpdate?: boolean; manualUpdate?: boolean;