Compare commits

...

2 Commits

Author SHA1 Message Date
beec26367f fix: fix type for autoresize, closes #800 2024-08-04 07:38:57 +08:00
b366b31afb docs: add peer deps update for echarts in changelog 2024-08-03 16:31:17 +08:00
4 changed files with 16 additions and 11 deletions

View File

@ -1,3 +1,7 @@
## 7.0.1
* Fixed type for `autoresize`.
## 7.0.0
> Other prerelease changes:
@ -13,6 +17,7 @@
### 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 Vue < 2.7.
* Dropped CJS outputs.

View File

@ -1,6 +1,6 @@
{
"name": "vue-echarts",
"version": "7.0.0",
"version": "7.0.1",
"description": "Vue.js component for Apache ECharts™.",
"license": "MIT",
"repository": "https://github.com/ecomfe/vue-echarts.git",

View File

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

View File

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