diff --git a/src/components/RightPanel/index.vue b/src/components/RightPanel/index.vue index 085ed82472335ac3f164e066a741090d67e88c84..43c6afcfdffe4999382173fd0e5178c5f6490d5b 100644 --- a/src/components/RightPanel/index.vue +++ b/src/components/RightPanel/index.vue @@ -3,10 +3,6 @@ import { onBeforeUnmount, onMounted, ref, watch } from 'vue'; import { addClass, removeClass } from '@/utils/index'; -// 图标依赖 -import { Close, Setting } from '@element-plus/icons-vue'; -import { ElColorPicker } from 'element-plus'; - const show = ref(false); defineProps({ @@ -33,24 +29,18 @@ function addEventClick() { function closeSidebar(evt: any) { // 主题选择点击不关闭 - let parent = evt.target.closest('.theme-picker-dropdown'); - if (parent) { - return; - } - - parent = evt.target.closest('.right-panel'); + let parent = evt.target.closest('.right-panel-container'); if (!parent) { show.value = false; window.removeEventListener('click', closeSidebar); } } -const rightPanel = ref(ElColorPicker); +const rightPanel = ref(); function insertToBody() { - const elx = rightPanel.value as any; const body = document.querySelector('body') as any; - body.insertBefore(elx, body.firstChild); + body.insertBefore(rightPanel.value, body.firstChild); } onMounted(() => { @@ -58,53 +48,46 @@ onMounted(() => { }); onBeforeUnmount(() => { - const elx = rightPanel.value as any; - elx.remove(); + rightPanel.value.remove(); }); - - -