feat(components): 为 contenteditable组件添加错误消息显示
- 在 contenteditable.vue 中添加了 errorMessage属性和对应的样式 - 在多个组件中为 contenteditable 添加了 errorMessage 属性 - 优化了部分代码格式,如空格、换行等
This commit is contained in:
@@ -11,7 +11,12 @@
|
||||
{{ index + 1 }}
|
||||
</template>
|
||||
<template #label>
|
||||
<contenteditable v-model="element.stem" :active="active" @blur="saveStem"></contenteditable>
|
||||
<contenteditable
|
||||
v-model="element.stem"
|
||||
:active="active"
|
||||
@blur="saveStem"
|
||||
:errorMessage="errorMessage"
|
||||
></contenteditable>
|
||||
</template>
|
||||
<template #input>
|
||||
<div
|
||||
@@ -43,7 +48,7 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from 'vue';
|
||||
import { defineModel, ref } from 'vue';
|
||||
import RateCharacter from './RateCharacter.vue';
|
||||
|
||||
const value = defineModel('value', { default: -1, type: Number });
|
||||
@@ -60,7 +65,10 @@ const isPreview = defineModel('isPreview', { default: false, type: Boolean });
|
||||
sn: { type: String, default: '' },
|
||||
questionType: { type: [String, Number], default: 4 }
|
||||
});
|
||||
|
||||
const errorMessage = defineModel('errorMessage', {
|
||||
type: String,
|
||||
default: ''
|
||||
});
|
||||
/**
|
||||
* element === question
|
||||
* @type {ModelRef<Object, string, Object, Object>}
|
||||
|
||||
Reference in New Issue
Block a user