From c8188a5110b60d1a129395c1e0127fd6a7ab60b1 Mon Sep 17 00:00:00 2001 From: lidong01 Date: Mon, 14 Aug 2023 13:52:44 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=8B=96=E6=8B=BD=E6=A8=A1=E5=BC=8F?= =?UTF-8?q?=E6=96=B0=E5=A2=9Edrag-mode=E5=8F=82=E6=95=B0=EF=BC=8C=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E7=94=A8=E6=88=B7=E8=87=AA=E5=AE=9A=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../formEditor/components/Selection/selectElement.jsx | 10 +++++++++- packages/formEditor/index.vue | 5 +++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/packages/formEditor/components/Selection/selectElement.jsx b/packages/formEditor/components/Selection/selectElement.jsx index c73b403..5d8fc9c 100644 --- a/packages/formEditor/components/Selection/selectElement.jsx +++ b/packages/formEditor/components/Selection/selectElement.jsx @@ -277,7 +277,7 @@ export default { {...useAttrs()} class={[ ns.b(), - unref(isEditModel) && props.hasDrag && 'handle', + unref(isEditModel) && ER?.props?.dragMode === 'full' && props.hasDrag && 'handle', !isField && ns.e('borderless'), unref(isEditModel) && ns.e('editor'), unref(isEditModel) && Selected.value, @@ -288,6 +288,14 @@ export default { ref={elementRef} onClick={unref(isEditModel) && withModifiers(handleClick, ['stop'])} > {slots.default()} + { + ER?.props?.dragMode === 'icon' && + unref(isEditModel) && ( +
+ {props.hasDrag && ()} +
+ ) + } { unref(isEditModel) && (
diff --git a/packages/formEditor/index.vue b/packages/formEditor/index.vue index b2b3b93..6a25991 100644 --- a/packages/formEditor/index.vue +++ b/packages/formEditor/index.vue @@ -46,6 +46,11 @@ const props = defineProps(_.merge({ isShowI18n: { type: Boolean, default: true + }, + dragMode: { + type: String, + default: 'icon', + validator: (value) => ['full', 'icon'].includes(value) } }, defaultProps)) const layout = {