vue-hooks-plus
Version:
Vue hooks library
18 lines (17 loc) • 619 B
TypeScript
import { Ref } from 'vue';
export interface UseExternalOptions {
/**
* The type of extarnal resources which need to load, support `js`/`css`, if no type, it will deduced according to path
*/
type?: 'js' | 'css';
/**
* Attributes supported by `script`
*/
js?: Partial<HTMLScriptElement>;
/**
* Attributes supported by `link`
*/
css?: Partial<HTMLStyleElement>;
}
export type UseExternalStatus = 'unset' | 'loading' | 'ready' | 'error';
export default function useExternal(path?: string | Ref<string>, options?: UseExternalOptions): Readonly<Ref<UseExternalStatus>>;