Show.vue 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. <template>
  2. <div style="line-height: 1.8">
  3. <template v-if="qType === 1">
  4. <div class="q-title" v-html="question.title"></div>
  5. <div class="q-content">
  6. <span v-for="item in question.items" :key="item.id" class="q-item-contain">
  7. <span class="q-item-prefix">{{ item.prefix }}</span>
  8. <span v-html="item.content" class="q-item-content"></span>
  9. </span>
  10. </div>
  11. </template>
  12. <template v-else-if="qType === 2">
  13. <div class="q-title" v-html="question.title"></div>
  14. <div class="q-content">
  15. <span v-for="item in question.items" :key="item.id" class="q-item-contain">
  16. <span class="q-item-prefix">{{ item.prefix }}</span>
  17. <span v-html="item.content" class="q-item-content"></span>
  18. </span>
  19. </div>
  20. </template>
  21. <template v-else-if="qType === 3">
  22. <div class="q-title" v-html="question.title" style="display: inline; margin-right: 10px"></div>
  23. <span>(</span>
  24. <span v-for="item in question.items" :key="item.id">
  25. <span v-html="item.content" class="q-item-content"></span>
  26. </span>
  27. <span>)</span>
  28. </template>
  29. <template v-else-if="qType === 4">
  30. <div class="q-title" v-html="question.title"></div>
  31. </template>
  32. <template v-else-if="qType === 5">
  33. <div class="q-title" v-html="question.title"></div>
  34. </template>
  35. <template v-else> </template>
  36. </div>
  37. </template>
  38. <script setup>
  39. import { computed } from 'vue'
  40. const props = defineProps({
  41. question: {
  42. type: Object,
  43. default: () => ({})
  44. },
  45. qLoading: {
  46. type: Boolean,
  47. default: false
  48. },
  49. qType: {
  50. type: Number,
  51. default: 0
  52. }
  53. })
  54. </script>
  55. <style scoped>
  56. .q-title {
  57. font-weight: bold;
  58. margin-bottom: 8px;
  59. }
  60. .q-content {
  61. margin-left: 16px;
  62. }
  63. .q-item-contain {
  64. display: inline-block;
  65. margin-right: 16px;
  66. margin-bottom: 4px;
  67. }
  68. .q-item-prefix {
  69. font-weight: bold;
  70. margin-right: 4px;
  71. }
  72. .q-item-content {
  73. display: inline;
  74. }
  75. </style>