From 3ddb338055421197deb3267ea426e880922d4828 Mon Sep 17 00:00:00 2001 From: zcating Date: Sun, 5 Sep 2021 13:32:21 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix(overlay):=20wrapperClass=20=E4=B8=8D?= =?UTF-8?q?=E5=AD=98=E5=9C=A8=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- devui/overlay/src/fixed-overlay.tsx | 20 ++++++-------------- devui/overlay/src/overlay.scss | 1 + sites/components/overlay/index.md | 2 +- 3 files changed, 8 insertions(+), 15 deletions(-) diff --git a/devui/overlay/src/fixed-overlay.tsx b/devui/overlay/src/fixed-overlay.tsx index 5b6e903c..ea6aaadb 100644 --- a/devui/overlay/src/fixed-overlay.tsx +++ b/devui/overlay/src/fixed-overlay.tsx @@ -20,22 +20,14 @@ export const FixedOverlay = defineComponent({ const overlayRef = ref(null); const handleBubbleCancel = (event: Event) => (event.cancelBubble = true); - const panelStyle: CSSProperties = { - position: 'fixed', - top: '0', - left: '0', - width: '100vw', - height: '100vh', - display: 'flex', - }; return () => ( -
-
+
+
{{fixedVisible ? '隐藏' : '显示固定浮层' }} - +
hello world
-- Gitee From a6a15619b5a7a7c6766da905a7f4d0855778bbf7 Mon Sep 17 00:00:00 2001 From: zhuchenxi Date: Tue, 7 Sep 2021 15:00:35 +0800 Subject: [PATCH 2/2] =?UTF-8?q?feat(overlay):=20=E5=AE=8C=E5=96=84=20overl?= =?UTF-8?q?ay=20=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- devui/overlay/src/flexible-overlay.tsx | 4 + sites/components/overlay/index.md | 170 +++++++++++++++++++++---- 2 files changed, 150 insertions(+), 24 deletions(-) diff --git a/devui/overlay/src/flexible-overlay.tsx b/devui/overlay/src/flexible-overlay.tsx index 6129b187..1bc25367 100644 --- a/devui/overlay/src/flexible-overlay.tsx +++ b/devui/overlay/src/flexible-overlay.tsx @@ -84,6 +84,10 @@ export const FlexibleOverlay = defineComponent({ }); }); + watch(toRef(props, 'position'), () => { + handleChange(); + }); + const resizeObserver = new ResizeObserver((entries) => { handleRectChange(entries[0].contentRect); }); diff --git a/sites/components/overlay/index.md b/sites/components/overlay/index.md index 43588394..9e62a237 100644 --- a/sites/components/overlay/index.md +++ b/sites/components/overlay/index.md @@ -1,46 +1,128 @@ ## 浮层 - +浮层属于基础组件,用于构建独立于当前页面布局的组件。 +### 何时使用 +当你需要全局弹窗,或者需要元素跟随功能,便可以使用该组件。 ### 固定浮层 -{{fixedVisible ? '隐藏' : '显示固定浮层' }} - -
hello world
-
+:::demo 使用`sm`,`''`,`lg`来定义`Search`基本类型 -### 弹性浮层 -
-
orgin
- {{visible ? '隐藏' : '显示' }} -
+```vue + + +``` +::: - -
hello world
-
+### 弹性浮层 + +:::demo +```vue +