Compare commits

...

5 Commits

8 changed files with 36 additions and 22 deletions

View File

@ -1,3 +1,15 @@
## 7.0.3
* Fixed type for `autoresize` (again).
## 7.0.2
* Fixed style injection regression (#805).
## 7.0.1
* Fixed type for `autoresize`.
## 7.0.0 ## 7.0.0
> Other prerelease changes: > Other prerelease changes:
@ -13,6 +25,7 @@
### Breaking changes ### Breaking changes
* Peer deps for `echarts` is upgraded to `^5.5.1`.
* Dropped support for browsers without `ResizeObserver`. Can work with [resize-observer-polyfill](https://www.npmjs.com/package/resize-observer-polyfill). * Dropped support for browsers without `ResizeObserver`. Can work with [resize-observer-polyfill](https://www.npmjs.com/package/resize-observer-polyfill).
* Dropped support for Vue < 2.7. * Dropped support for Vue < 2.7.
* Dropped CJS outputs. * Dropped CJS outputs.

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.0"></script> <script src="https://cdn.jsdelivr.net/npm/vue-echarts@7.0.3"></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.0"></script> <script src="https://cdn.jsdelivr.net/npm/vue-echarts@7.0.3"></script>
``` ```
<!-- vue2Scripts:end --> <!-- vue2Scripts:end -->

View File

@ -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.0"></script> <script src="https://cdn.jsdelivr.net/npm/vue-echarts@7.0.3"></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.0"></script> <script src="https://cdn.jsdelivr.net/npm/vue-echarts@7.0.3"></script>
``` ```
<!-- vue2Scripts:end --> <!-- vue2Scripts:end -->

View File

@ -1,6 +1,6 @@
{ {
"name": "vue-echarts", "name": "vue-echarts",
"version": "7.0.0", "version": "7.0.3",
"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.0", "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",

10
pnpm-lock.yaml generated
View File

@ -127,8 +127,8 @@ importers:
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: rollup-plugin-import-css:
specifier: ^3.5.0 specifier: ^3.5.1
version: 3.5.0(rollup@4.19.0) 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
@ -4070,8 +4070,8 @@ 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.0: rollup-plugin-import-css@3.5.1:
resolution: {integrity: sha512-JOVow6n00qt2C/NnsqPmIjFOfxIAudwWqC5SaC84CodMGiMFaP1gPAdgnJ8g8hcG+P85TCYp2kI98grYCEt5pg==} resolution: {integrity: sha512-cXgMPCUoDu64A2OFme4Is3eHmLiA54qTzxfvCbsORzro3C1adSe1fMMKUqfOUKTXROAPpW9PNDjpaGgPloGJOQ==}
engines: {node: '>=16'} engines: {node: '>=16'}
peerDependencies: peerDependencies:
rollup: ^2.x.x || ^3.x.x || ^4.x.x rollup: ^2.x.x || ^3.x.x || ^4.x.x
@ -8983,7 +8983,7 @@ snapshots:
transitivePeerDependencies: transitivePeerDependencies:
- supports-color - supports-color
rollup-plugin-import-css@3.5.0(rollup@4.19.0): rollup-plugin-import-css@3.5.1(rollup@4.19.0):
dependencies: dependencies:
'@rollup/pluginutils': 5.1.0(rollup@4.19.0) '@rollup/pluginutils': 5.1.0(rollup@4.19.0)
rollup: 4.19.0 rollup: 4.19.0

View File

@ -2,18 +2,11 @@ import { watch } from "vue-demi";
import { throttle } from "echarts/core"; import { throttle } from "echarts/core";
import type { Ref, PropType } from "vue-demi"; import type { Ref, PropType } from "vue-demi";
import type { EChartsType } from "../types"; import type { EChartsType, AutoResize } from "../types";
type AutoresizeProp =
| boolean
| {
throttle?: number;
onResize?: () => void;
};
export function useAutoresize( export function useAutoresize(
chart: Ref<EChartsType | undefined>, chart: Ref<EChartsType | undefined>,
autoresize: Ref<AutoresizeProp | undefined>, autoresize: Ref<AutoResize | undefined>,
root: Ref<HTMLElement | undefined> root: Ref<HTMLElement | undefined>
): void { ): void {
watch( watch(
@ -63,5 +56,5 @@ export function useAutoresize(
} }
export const autoresizeProps = { export const autoresizeProps = {
autoresize: [Boolean, Object] as PropType<AutoresizeProp> autoresize: [Boolean, Object] as PropType<AutoResize>
}; };

3
src/index.d.ts vendored
View File

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

View File

@ -23,6 +23,13 @@ export type EventTarget = EChartsType | ZRenderType;
type SetOptionType = EChartsType["setOption"]; type SetOptionType = EChartsType["setOption"];
export type Option = Parameters<SetOptionType>[0]; export type Option = Parameters<SetOptionType>[0];
export type AutoResize =
| boolean
| {
throttle?: number;
onResize?: () => void;
};
export type LoadingOptions = { export type LoadingOptions = {
text?: string; text?: string;
textColor?: string; textColor?: string;