fix: 修复某些组件页面重复进入无法正常预览的问题
- 修复单选、打分、NPS无法正常预览的问题
This commit is contained in:
@@ -20,7 +20,7 @@
|
||||
</contenteditable>
|
||||
</template>
|
||||
<template #input>
|
||||
<template v-for="item /*optionIndex*/ in element.options" :key="item.id">
|
||||
<template v-for="item /*optionIndex*/ in element.list ?? element.options" :key="item.id">
|
||||
<van-radio-group v-if="element.question_type === 1" v-model="choiceValue">
|
||||
<option-action
|
||||
:data="isPreview ? item.options : item"
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
</template>
|
||||
<template #input>
|
||||
<div
|
||||
v-for="(optionItem, optionItemIndex) in isPreview ? element.list : element.options"
|
||||
v-for="(optionItem, optionItemIndex) in element.list ?? element.options"
|
||||
:key="optionItemIndex"
|
||||
class="rate-content"
|
||||
>
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
</template>
|
||||
<template #input>
|
||||
<div
|
||||
v-for="(optionItem, optionItemIndex) in element.options"
|
||||
v-for="(optionItem, optionItemIndex) in element.list ?? element.options"
|
||||
:key="optionItemIndex"
|
||||
class="rate-content"
|
||||
>
|
||||
@@ -53,7 +53,7 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { defineModel, ref, watch } from 'vue';
|
||||
import { defineModel, ref } from 'vue';
|
||||
import RateCharacter from './RateCharacter.vue';
|
||||
|
||||
/**
|
||||
@@ -63,6 +63,7 @@ const element = defineModel('element', {
|
||||
type: Object,
|
||||
required: true
|
||||
});
|
||||
|
||||
// 答案数值
|
||||
const answerValue = defineModel('answerValue', {
|
||||
default: () => [],
|
||||
|
||||
@@ -563,7 +563,6 @@ const {
|
||||
translatedText
|
||||
} = storeToRefs(questionStore);
|
||||
|
||||
// console.log(`questionsData`, questions.value);
|
||||
const props = defineProps({
|
||||
isTemplate: {
|
||||
type: Boolean,
|
||||
@@ -589,7 +588,6 @@ async function getQuestions() {
|
||||
}
|
||||
});
|
||||
data = data.data;
|
||||
// console.log(`response data: `, data);
|
||||
// 多语言
|
||||
data.languageType = [
|
||||
data?.survey?.style?.is_en_tips ? 'en' : '',
|
||||
|
||||
@@ -18,14 +18,7 @@ const value = ref<number[]>([]);
|
||||
// // 预览新增 emit ['changeAnswer', 'previous', 'next']
|
||||
const emit = defineEmits(['changeAnswer', 'previous', 'next', 'update:element']);
|
||||
const question = defineModel<question>('question', { default: { config: { is_required: false } } });
|
||||
initData();
|
||||
function initData() {
|
||||
if (question.value?.options) {
|
||||
// question.value?.list = question.value?.options;
|
||||
} else if (question.value.list.length) {
|
||||
question.value.options = question.value.list;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* answer 的答案类型
|
||||
* {
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
import imgUrl from '@/assets/img/create-right-back.png';
|
||||
|
||||
export { imgUrl };
|
||||
Reference in New Issue
Block a user