fix: 移除选项默认选中

This commit is contained in:
sudoooooo 2024-07-15 18:00:07 +08:00
parent a14d444960
commit 2044da4be9

View File

@ -14,7 +14,6 @@
<RichEditor <RichEditor
:modelValue="element.text" :modelValue="element.text"
@change="(value) => handleChange(index, value)" @change="(value) => handleChange(index, value)"
@created="handleCreated"
/> />
</div> </div>
@ -42,7 +41,6 @@
import draggable from 'vuedraggable' import draggable from 'vuedraggable'
import { cloneDeep as _cloneDeep } from 'lodash-es' import { cloneDeep as _cloneDeep } from 'lodash-es'
import RichEditor from '@/common/Editor/RichEditor.vue' import RichEditor from '@/common/Editor/RichEditor.vue'
import { mapGetters, mapState } from 'vuex'
export default { export default {
name: 'OptionEdit', name: 'OptionEdit',
@ -60,14 +58,6 @@ export default {
draggable, draggable,
RichEditor RichEditor
}, },
data() {
return {
//
createdEditorCount: 0,
//
editorList: []
}
},
mounted() { mounted() {
// hash // hash
const hashMap = {} const hashMap = {}
@ -111,29 +101,6 @@ export default {
optionSortChange() { optionSortChange() {
const optionList = _cloneDeep(this.optionList) const optionList = _cloneDeep(this.optionList)
this.$emit('optionChange', optionList) this.$emit('optionChange', optionList)
},
// editor
handleCreated(editor) {
this.createdEditorCount++
this.editorList.push(editor)
}
},
computed: {
...mapGetters({
moduleConfig: 'edit/moduleConfig'
}),
//
createdAllCurrentEditQuestionEditor() {
return this.createdEditorCount === this.moduleConfig?.options?.length
}
},
watch: {
//
//
createdAllCurrentEditQuestionEditor(bool) {
if (bool) {
this.editorList[0]?.focus()
}
} }
} }
} }