|
@@ -10,24 +10,24 @@
|
|
|
<swiper class="swiper-box" @change="onSwitchChange" :current="swiperDotIndex">
|
|
|
<swiper-item v-for="(item,index) in data.content" :key="index" class="swiper-item-content">
|
|
|
<view class="swiper-item" :class="'swiper-item' + index" style="background-color: #ccc;">
|
|
|
- <template v-if="item.stTypeId == 1">
|
|
|
+ <template v-if="item.type == 'danxuan'">
|
|
|
<!-- 单选 -->
|
|
|
- <danxuan :question="item" :key="item.stId"></danxuan>
|
|
|
+ <danxuan :question="item" :key="item.stId"></danxuan>
|
|
|
</template>
|
|
|
- <template v-if="item.stTypeId == 2">
|
|
|
+ <template v-if="item.type == 'duoxuan'">
|
|
|
|
|
|
<!-- 多选 -->
|
|
|
<duoxuan :question="item" :key="item.stId"></duoxuan>
|
|
|
</template>
|
|
|
- <template v-if="item.stTypeId == 3">
|
|
|
+ <template v-if="item.type == 'panduan'">
|
|
|
<!-- 判断 -->
|
|
|
<panduan :question="item" :key="item.stId"></panduan>
|
|
|
</template>
|
|
|
- <template v-if="item.stTypeId == 4">
|
|
|
+ <template v-if="item.type == 'tiankong'">
|
|
|
<!-- 填空 -->
|
|
|
<tiankong :question="item" :key="item.stId"></tiankong>
|
|
|
</template>
|
|
|
- <template v-if="item.stTypeId == 5">
|
|
|
+ <template v-if="item.type == 'jianda'">
|
|
|
<!-- 简答 -->
|
|
|
<jianda :question="item" :key="item.stId"></jianda>
|
|
|
</template>
|
|
@@ -66,6 +66,13 @@
|
|
|
const swiperDotIndex = ref(0);
|
|
|
|
|
|
watch(() => props.question, (question) => {
|
|
|
+ const danxuanlist = question.danxuan.forEach(item => item.type = 'danxuan')
|
|
|
+ const duoxuanlist = question.duoxuan.forEach(item => item.type = 'duoxuan')
|
|
|
+ const panduanlist = question.panduan.forEach(item => item.type = 'panduan')
|
|
|
+ const tiankonglist = question.tiankong.forEach(item => item.type = 'tiankong')
|
|
|
+ const jiandalist = question.jianda.forEach(item => item.type = 'jianda')
|
|
|
+
|
|
|
+
|
|
|
data.content = [...question.danxuan, ...question.duoxuan, ...question.panduan, ...question.tiankong, ...
|
|
|
question.jianda
|
|
|
];
|