actorref(src): 重构组件以提高代码可维护性
- 更新了多个组件的属性定义和事件处理逻辑 - 优化了部分代码结构,提高了代码的可读性和可维护性 -调整了部分样式,提升了用户体验
This commit is contained in:
@@ -40,17 +40,9 @@
|
||||
</template>
|
||||
<script setup>
|
||||
import QuestionAction from '@/views/Design/components/ActionCompoents/QuestionAction.vue';
|
||||
import { ref } from 'vue';
|
||||
|
||||
import { basicQuesTypeList } from '@/utils/common.js';
|
||||
|
||||
const props = defineProps({
|
||||
element: {
|
||||
type: Object,
|
||||
default: () => {
|
||||
// 此方法目前为空,未来可能扩展
|
||||
}
|
||||
},
|
||||
index: {
|
||||
type: Number,
|
||||
default: 0
|
||||
@@ -86,14 +78,19 @@ const getQuestionType = (type) => {
|
||||
return typeName;
|
||||
};
|
||||
|
||||
const element = ref(props.element);
|
||||
const element = defineModel('element', {
|
||||
type: Object,
|
||||
default: () => {
|
||||
return {};
|
||||
}
|
||||
});
|
||||
|
||||
// 选中题目后出现的操作
|
||||
const emit = defineEmits(['getChooseQuestionId', 'move', 'copy', 'setting', 'logics']);
|
||||
|
||||
// 选中题目
|
||||
const chooseItem = () => {
|
||||
emit('getChooseQuestionId', props.element, props.index);
|
||||
emit('getChooseQuestionId', element.value, props.index);
|
||||
};
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
|
||||
Reference in New Issue
Block a user