- loadScript(url: string): Promise<HTMLScriptElement>
-
Returns Promise<HTMLScriptElement>
- loadScript(url: string, props: Partial<HTMLScriptElement>): Promise<HTMLScriptElement>
-
Parameters
-
url: string
-
props: Partial<HTMLScriptElement>
Returns Promise<HTMLScriptElement>
- loadScript(param: {
url: string;
props?: Partial<HTMLScriptElement>;
attrs?: object;
onLoad: ((el: HTMLScriptElement) => void);
onError?: Function;
}): void
-
Parameters
-
param: {
url: string;
props?: Partial<HTMLScriptElement>;
attrs?: object;
onLoad: ((el: HTMLScriptElement) => void);
onError?: Function;
}
-
url: string
-
Optional
props?: Partial<HTMLScriptElement>
-
Optional
attrs?: object
-
onLoad: ((el: HTMLScriptElement) => void)
-
- (el: HTMLScriptElement): void
-
Returns void
-
Optional
onError?: Function
Returns void
- loadScript(param: {
url: string;
props?: Partial<HTMLScriptElement>;
attrs?: object;
onLoad?: ((el: HTMLScriptElement) => void);
onError: Function;
}): void
-
Parameters
-
param: {
url: string;
props?: Partial<HTMLScriptElement>;
attrs?: object;
onLoad?: ((el: HTMLScriptElement) => void);
onError: Function;
}
-
url: string
-
Optional
props?: Partial<HTMLScriptElement>
-
Optional
attrs?: object
-
Optional
onLoad?: ((el: HTMLScriptElement) => void)
-
- (el: HTMLScriptElement): void
-
Returns void
-
onError: Function
Returns void
手动添加script