From 52ad8d92a19e8458a2820f3375fedd3e3296cc6a Mon Sep 17 00:00:00 2001 From: dataeaseShu Date: Tue, 14 May 2024 10:31:20 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E5=88=A0=E9=99=A4import=20'element?= =?UTF-8?q?-plus-secondary/es/css=20=20#9624?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/core-frontend/src/directive/ClickOutside/index.ts | 4 +++- core/core-frontend/src/plugins/element-plus/index.ts | 1 - 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/core/core-frontend/src/directive/ClickOutside/index.ts b/core/core-frontend/src/directive/ClickOutside/index.ts index 6e91b07fcc..b9fbf3e92a 100644 --- a/core/core-frontend/src/directive/ClickOutside/index.ts +++ b/core/core-frontend/src/directive/ClickOutside/index.ts @@ -2,7 +2,9 @@ export const vClickOutside = { beforeMount(el, binding) { el.clickOutsideEvent = function (event) { if (!(el === event.target || el.contains(event.target))) { - binding.value(event) + if (typeof binding.value === 'function') { + binding.value(event) + } } } document.addEventListener('click', el.clickOutsideEvent) diff --git a/core/core-frontend/src/plugins/element-plus/index.ts b/core/core-frontend/src/plugins/element-plus/index.ts index 7f60d491d2..604f68eae6 100644 --- a/core/core-frontend/src/plugins/element-plus/index.ts +++ b/core/core-frontend/src/plugins/element-plus/index.ts @@ -2,7 +2,6 @@ import type { App } from 'vue' // 需要全局引入一些组件,如ElScrollbar,不然一些下拉项样式有问题 import { ElLoading, ElScrollbar } from 'element-plus-secondary' -import 'element-plus-secondary/es/css' import * as ElementPlusIconsVue from '@element-plus/icons-vue' const plugins = [ElLoading]