import { Grid, GridItem } from 'vant' import { defineComponent, PropType } from 'vue' import styles from './index.module.less' export default defineComponent({ name: 'answer-list', props: { value: { type: Array, default: () => [] }, index: { type: Number, default: 0 }, lookType: { type: String as PropType<'ANSWER' | 'RESULT' | 'CLICK' | 'PRACTICE'>, default: 'ANSWER' }, statusList: { type: Array, default: () => [ { text: '已答', color: '#FF8057' }, { text: '未答', color: '#EAEAEA' } ] }, // 结果 answerResult: { type: Array, default: () => [] } }, emits: ['select'], setup(props, { emit }) { console.log(props.lookType, 'lookType') /** * @description 检查用户是否答对 * @returns Boolean */ const formatUserResult = (id: string) => { let result = false props.answerResult.forEach((item: any) => { if (item.questionId === id) { result = item.rightFlag } }) return result } return () => (