From b24f695cd7989d8afb8b31d20a6036db1a2f68ac Mon Sep 17 00:00:00 2001 From: Sight <1453017105@qq.com> Date: Sun, 23 Jan 2022 10:57:56 +0000 Subject: [PATCH] =?UTF-8?q?refactor(layer):=20=E5=85=A8=E5=B1=80=E5=BC=95?= =?UTF-8?q?=E5=85=A5=E6=97=B6=E6=8C=82=E8=BD=BD=20layer=20=E5=88=B0=20glob?= =?UTF-8?q?alProperties=EF=BC=8C=E4=BC=98=E5=8C=96=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=E4=BD=93=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/index.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index cce35497..3aab5b2c 100644 --- a/src/index.ts +++ b/src/index.ts @@ -4,7 +4,7 @@ import type { IDefineComponent, InstallOptions } from "./component/type/index"; import "./theme/layui.css"; import "@layui/layer-vue/lib/index.css"; import "@layui/icons-vue/lib/index.css"; -import { layer } from "@layui/layer-vue"; +import { layer, useLayer } from "@layui/layer-vue"; import LayLayer from "./component/layer/index"; import LayBacktop from "./component/backTop/index"; @@ -149,6 +149,7 @@ const components: Record = { const install = (app: App, options?: InstallOptions): void => { const _options = options; app.config.globalProperties.$PROOPTIONS = _options; + app.config.globalProperties.$layer = useLayer(app._context); for (const key in components) { const item = components[key]; app.component(item.name || key, item);