refactor: rename options to option to align with ECharts itself

- removed built-in styles
- use ECharts' built-in throttle
- generate bundled .d.ts, hack three methods for now
- loadingOptions can be any object type
This commit is contained in:
Justineo
2021-02-19 17:54:08 +08:00
parent ee12ad9658
commit 419d79f86f
10 changed files with 258 additions and 507 deletions

View File

@ -1,25 +1,10 @@
import { Ref, PropType, watchEffect } from "vue";
import { EChartsType } from "@/types";
export interface LoadingOptions {
text?: string;
color?: string;
textColor?: string;
maskColor?: string;
zlevel?: number;
fontSize?: number;
showSpinner?: boolean;
spinnerRadius?: number;
lineWidth?: number;
fontWeight?: string | number;
fontStyle?: string;
fontFamily?: string;
}
import { Ref, watchEffect } from "vue-demi";
import { EChartsType } from "../types";
export function useLoading(
chart: Ref<EChartsType | undefined>,
loading: Ref<boolean>,
loadingOptions?: Ref<LoadingOptions | undefined>
loadingOptions?: Ref<object | undefined>
): void {
watchEffect(() => {
const instance = chart.value;
@ -37,5 +22,5 @@ export function useLoading(
export const loadingProps = {
loading: Boolean,
loadingOptions: Object as PropType<LoadingOptions>
loadingOptions: Object
};