mirror of
https://github.com/ecomfe/vue-echarts.git
synced 2025-08-15 11:55:49 +08:00
fix: fix type for autoresize
, closes #800
This commit is contained in:
@ -1,3 +1,7 @@
|
|||||||
|
## 7.0.1
|
||||||
|
|
||||||
|
* Fixed type for `autoresize`.
|
||||||
|
|
||||||
## 7.0.0
|
## 7.0.0
|
||||||
|
|
||||||
> Other prerelease changes:
|
> Other prerelease changes:
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "vue-echarts",
|
"name": "vue-echarts",
|
||||||
"version": "7.0.0",
|
"version": "7.0.1",
|
||||||
"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",
|
||||||
|
@ -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>
|
||||||
};
|
};
|
||||||
|
@ -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;
|
||||||
|
Reference in New Issue
Block a user