From 70cf9c02680ee63b63097688d1063ad80aaa4adc Mon Sep 17 00:00:00 2001 From: XieYongHong <18010623010@163.com> Date: Sat, 15 Jul 2023 21:08:55 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=E5=BC=82=E6=AD=A5?= =?UTF-8?q?=E6=96=B0=E5=BB=BAscript=E6=A0=87=E7=AD=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/document.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 src/utils/document.ts diff --git a/src/utils/document.ts b/src/utils/document.ts new file mode 100644 index 00000000..6d5cea07 --- /dev/null +++ b/src/utils/document.ts @@ -0,0 +1,10 @@ +export const createScript = (src: string) => { + return new Promise((resolve) => { + const script = document.createElement('script') + script.onload = () => { + resolve(true) + } + script.setAttribute('type', 'text/javascript') + script.setAttribute('src', src) + }) +} \ No newline at end of file