feat(components): 为 contenteditable组件添加错误消息显示

- 在 contenteditable.vue 中添加了 errorMessage属性和对应的样式
- 在多个组件中为 contenteditable 添加了 errorMessage 属性
- 优化了部分代码格式,如空格、换行等
This commit is contained in:
陈昱达
2025-03-20 18:28:39 +08:00
parent 289b865c51
commit bfa163925e
9 changed files with 109 additions and 50 deletions

View File

@@ -15,6 +15,7 @@
className="contenteditable-label"
:active="active"
@blur="emitValue"
:errorMessage="errorMessage"
>
</contenteditable>
</template>
@@ -108,7 +109,7 @@ import { defineAsyncComponent } from 'vue';
const isPreview = defineModel('isPreview', { default: false, type: Boolean });
const choiceValue = defineModel('answer', { default: '1', type: String });
const value = defineModel('checkboxAnswer', { default: [1, 2], type: Array });
const errorMessage = defineModel('errorMessage', { default: '', type: String });
const Contenteditable = defineAsyncComponent(() => import('@/components/contenteditable.vue'));
defineProps({
active: {