mirror of
https://github.com/ecomfe/vue-echarts.git
synced 2025-10-28 03:25:02 +08:00
fix: fix type for autoresize, closes #800
This commit is contained in:
@ -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>
|
||||
};
|
||||
|
||||
@ -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;
|
||||
|
||||
Reference in New Issue
Block a user