feat: 完成 preview 组件的功能
- 新增 preview 组件相关的资源 - 调用 web 端部分 API - 相关题目添加答案配置
This commit is contained in:
@@ -24,7 +24,7 @@
|
||||
:key="optionIndex"
|
||||
@click="chooseOption(item)"
|
||||
>
|
||||
<RateCharacter :config="element.config"></RateCharacter>
|
||||
<RateCharacter v-model="answerValue" :config="element.config"></RateCharacter>
|
||||
<div class="tips">
|
||||
<p>{{ element.config.prompt_left }}</p>
|
||||
<p>{{ element.config.prompt_center }}</p>
|
||||
@@ -38,7 +38,7 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from 'vue';
|
||||
import { ref, onMounted } from 'vue';
|
||||
import RateCharacter from './RateCharacter.vue';
|
||||
|
||||
const props = defineProps({
|
||||
@@ -56,6 +56,16 @@ const props = defineProps({
|
||||
sn: { type: String, default: '' },
|
||||
questionType: { type: [String, Number], default: 4 }
|
||||
});
|
||||
|
||||
const answerValue = ref()
|
||||
// NPS 的答案
|
||||
const NPSAnswer = ref({
|
||||
'question_index': props.index,
|
||||
'answer': {
|
||||
'1': answerValue.value
|
||||
}
|
||||
});
|
||||
|
||||
const element = ref(props.element);
|
||||
const chooseId = ref('');
|
||||
// 创建一个本地副本以保存更改
|
||||
@@ -80,4 +90,4 @@ const chooseOption = (item) => {
|
||||
justify-content: space-between;
|
||||
color: #bfbfbf;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
Reference in New Issue
Block a user