import { defineComponent, PropType } from 'vue' import { Image, Button } from 'vant' import iconError from '../../images/icon-error.png' import styles from './index.module.less' export default defineComponent({ name: 'result-mode', props: { confirmButtonText: { type: String, default: '去练习' }, cancelButtonText: { type: String, default: '我知道了' }, status: { type: String as PropType<'SUCCESS' | 'FAIL' | 'PRACTICE'>, default: 'SUCCESS' }, result: { type: Object, default: () => ({ tips: '恭喜你,测验通过!', score: 0, examName: '' }) } }, emits: ['close', 'conform'], setup(props, { slots, emit }) { return () => (
{slots.content ? ( slots.content() ) : ( <>
{props.result.score}
{props.result.examName}
{props.result.tips}
)}
emit('close')}> {props.cancelButtonText}
emit('conform')}> {props.confirmButtonText}
) } })