index.tsx 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. import { defineComponent } from 'vue'
  2. import { Image, Button } from 'vant'
  3. import iconError from '../../images/icon-error.png'
  4. import styles from './index.module.less'
  5. export default defineComponent({
  6. name: 'result-mode',
  7. props: {
  8. confirmButtonText: {
  9. type: String,
  10. default: '我知道了'
  11. },
  12. answerAnalysis: {
  13. type: String,
  14. default: ''
  15. }
  16. },
  17. emits: ['close', 'conform'],
  18. setup(props, { emit }) {
  19. return () => (
  20. <div class={styles.popupResult}>
  21. <div class={styles.resultTitle}>
  22. <Image src={iconError} class={styles.titleImg} />
  23. 回答错误!
  24. </div>
  25. {/* <div class={styles.result}>
  26. 正确答案: <span class={styles.yes}>A</span>
  27. 您选择: <span class={styles.no}>B</span>
  28. </div> */}
  29. <div class={styles.resultContent}>
  30. <span>答案解析:</span>
  31. {props.answerAnalysis}
  32. </div>
  33. <Button
  34. type="primary"
  35. round
  36. class={styles.btn}
  37. block
  38. onClick={() => {
  39. emit('conform')
  40. emit('close')
  41. }}
  42. >
  43. {props.confirmButtonText}
  44. </Button>
  45. </div>
  46. )
  47. }
  48. })