|
1 | 1 | <template> |
2 | | - <div |
3 | | - class="rich-main-class" |
4 | | - :class="{ 'edit-model': configItem.editing }" |
5 | | - @keydown.stop |
6 | | - @keyup.stop |
7 | | - @dblclick="setEdit" |
8 | | - > |
| 2 | + <div class="rich-main-class" :class="{ 'edit-model': configItem.editing }" draggable="false"> |
| 3 | + <div |
| 4 | + draggable="false" |
| 5 | + :class="{ 'custom-text-content': true, 'preview-text': true, 'layer-hidden': !isDisabled }" |
| 6 | + @keydown.stop |
| 7 | + @keyup.stop |
| 8 | + @mousedown.stop |
| 9 | + @dblclick.stop="setEdit" |
| 10 | + v-html="configItem.propValue" |
| 11 | + ></div> |
9 | 12 | <editor |
10 | 13 | :id="tinymceId" |
11 | 14 | v-model="configItem.propValue" |
12 | | - :class="{ 'custom-text-content': true, dragHandle: isDisabled }" |
| 15 | + draggable="false" |
| 16 | + :class="{ 'custom-text-content': true, 'layer-hidden': isDisabled }" |
13 | 17 | :init="init" |
14 | 18 | ></editor> |
15 | 19 | </div> |
@@ -38,6 +42,8 @@ import '@npkg/tinymce-plugins/letterspacing' |
38 | 42 | import { computed, nextTick, type PropType, reactive, toRefs } from 'vue' |
39 | 43 | import { onMounted } from 'vue' |
40 | 44 | import type { CanvasItem } from '@/utils/canvas.ts' |
| 45 | +import { dashboardStoreWithOut } from '@/stores/dashboard/dashboard.ts' |
| 46 | +const dashboardStore = dashboardStoreWithOut() |
41 | 47 |
|
42 | 48 | const props = defineProps({ |
43 | 49 | configItem: { |
@@ -82,6 +88,7 @@ const isDisabled = computed(() => props.disabled || !configItem.value.editing) |
82 | 88 |
|
83 | 89 | const setEdit = () => { |
84 | 90 | configItem.value.editing = true |
| 91 | + dashboardStore.setCurComponent(configItem.value) |
85 | 92 | nextTick(() => { |
86 | 93 | editCursor() |
87 | 94 | }) |
@@ -163,9 +170,18 @@ onMounted(() => { |
163 | 170 | outline: none !important; |
164 | 171 | border: none !important; |
165 | 172 | margin: 2px; |
| 173 | + cursor: text; |
166 | 174 |
|
167 | 175 | ol { |
168 | 176 | list-style-type: decimal; |
169 | 177 | } |
170 | 178 | } |
| 179 | +
|
| 180 | +.layer-hidden { |
| 181 | + display: none !important; |
| 182 | +} |
| 183 | +
|
| 184 | +.preview-text { |
| 185 | + cursor: pointer; |
| 186 | +} |
171 | 187 | </style> |
0 commit comments