From 8d8772021ece9968d4968a59740e146bfea5632d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E6=98=B1=E8=BE=BE?= Date: Sat, 15 Mar 2025 18:09:27 +0800 Subject: [PATCH] =?UTF-8?q?feat(Design):=20=E4=BC=98=E5=8C=96=E9=97=AE?= =?UTF-8?q?=E5=8D=B7=E8=AE=BE=E8=AE=A1=E6=A0=B7=E5=BC=8F=E5=92=8C=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=20-=20=E5=AE=9E=E7=8E=B0=E9=80=89=E9=A1=B9=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 添加内容可编辑组件拖拽排序功能 - 优化题目和选项的样式 - 添加右键拖拽功能 --- src/assets/css/public.scss | 50 +++++++++- src/components/contenteditable.vue | 27 +++-- src/views/Design/Index.vue | 21 ++-- .../ActionCompoents/OptionAction.vue | 99 +++++++++++-------- .../Design/components/Questions/Choice.vue | 34 ++++++- 5 files changed, 171 insertions(+), 60 deletions(-) diff --git a/src/assets/css/public.scss b/src/assets/css/public.scss index b27aa60..8f88733 100644 --- a/src/assets/css/public.scss +++ b/src/assets/css/public.scss @@ -32,7 +32,7 @@ } } -.van-switch--on{ +.van-switch--on { background: $theme-color; } @@ -51,3 +51,51 @@ background-color: rgba(0, 0, 0, 0.7) !important; } } + +.contenteditable { + width: 100%; +} + +.contenteditable-input { + width: 100%; + padding: 5px 8px; + border: none; + border-radius: 8px; + background: #fafbfc; + outline: 1px solid #f4f4f4; + font-size: 14px; +} + +.contenteditable-label { + width: 100%; + + //outline: 1px solid #ccc; + //border-bottom: 1px solid #ccc; +} + +.contenteditable-question-title { + & .van-cell__title { + position: relative; + + &::after { + content: ' '; + position: absolute; + bottom: -2px; + box-sizing: border-box; + width: 100%; + border-bottom: 0.0267rem solid #ebedf0; + pointer-events: none; + transform: scaleY(0.5); + } + + &:focus-within::after { + border-bottom-color: $theme-color; + } + + & .contenteditable-label { + & :focus { + //color: green; + } + } + } +} diff --git a/src/components/contenteditable.vue b/src/components/contenteditable.vue index d5c0c4f..67418c6 100644 --- a/src/components/contenteditable.vue +++ b/src/components/contenteditable.vue @@ -1,11 +1,16 @@