feat(Design): 选择题支持单选和多选功能

- 修改 Choice 组件,支持单选和多选的渲染逻辑
- 新增 CheckboxAction 组件,用于多选题的排它项设置
- 更新 QuestionAction 组件,适配新的单选和多选逻辑
- 调整 Index 组件,支持单选和多选题的显示
- 修改 stores 中的 question_type 值,以区分单选和多选
This commit is contained in:
陈昱达
2025-03-06 11:41:12 +08:00
committed by Huangzhe
parent 811f441b69
commit 99070a8fa5
8 changed files with 105 additions and 17 deletions

View File

@@ -39,9 +39,11 @@
></van-switch>
</template>
</van-cell>
<van-divider></van-divider>
<van-cell title="下移选项" :border="false" @click="optionMove('down')"></van-cell>
<van-cell title="上移选项" :border="false" @click="optionMove('up')"></van-cell>
<!--复选时出现-->
<checkbox-action
v-if="question?.question_type === 2"
v-model="activeOption.is_remove_other"
></checkbox-action>
</van-cell-group>
</van-action-sheet>
<van-action-sheet
@@ -61,6 +63,7 @@
</van-action-sheet>
</template>
<script setup>
import CheckboxAction from './components/OptionItemAction/CheckboxAction.vue';
import { ref } from 'vue';
import { showConfirmDialog } from 'vant';
const props = defineProps({
@@ -75,6 +78,12 @@ const props = defineProps({
active: {
type: Boolean,
default: false
},
question: {
type: Object,
default: () => {
// 空
}
}
});