import { defineComponent, onMounted, ref } from 'vue'; import styles from './index.module.less'; import { Button, Cell, Icon, Image, Radio, RadioGroup } from 'vant'; import checkBoxActive from '../../images/new/icon-n-1.png'; import checkBoxDefault from '../../images/new/icon-n-2.png'; export default defineComponent({ name: 'select-student', props: { list: { type: Array, default: () => [] }, studentItem: { type: Object, default: () => ({}) } }, emits: ['close', 'confirm'], setup(props, { emit }) { const radioChecked = ref(); onMounted(() => { if (props.studentItem && props.studentItem.userId) { radioChecked.value = props.studentItem.userId; } }); return () => (
选择学生
{props.list.map((item: any) => (
{ radioChecked.value = item.userId; emit('confirm', item); emit('close'); }}> {{ icon: (props: any) => ( ) }}
{item.nickname}
{item.schoolName && (
{item.schoolName}
)}
))}
); } });