import { defineComponent, reactive, watch } from 'vue' import styles from './point.module.less' import { iconMulv, iconArrow } from '../image/icons.json' import iconZhibo from '../image/icon-load.gif' import { iconImage, iconImageActive, iconVideo, iconVideoActive, iconSong, iconSongActive } from '../image/icons.json' import { Collapse, CollapseItem, Icon, Image } from 'vant' import PlayLoading from './play-loading' export default defineComponent({ name: 'points-list', props: { data: { type: Array, default: () => [] }, tabActive: { type: [String, Number, Array], default: '' }, itemActive: { type: String, default: '' } }, emits: ['handleSelect'], setup(props, { emit }) { const pointData = reactive({ active: props.tabActive[0] || '', childActive: props.tabActive[1] || '' }) watch( () => props.tabActive, () => { pointData.active = props.tabActive[0] || '' pointData.childActive = props.tabActive[1] || '' } ) // 获取对应图片 const getImage = (item: any) => { if (item.type === 'VIDEO') { return props.itemActive == item.id ? iconVideoActive : iconVideo } else if (['IMAGE', 'IMG'].includes(item.type)) { return props.itemActive == item.id ? iconImageActive : iconImage } else if (item.type === 'SONG') { return props.itemActive == item.id ? iconSongActive : iconSong } else { return props.itemActive == item.id ? iconVideoActive : iconVideo } } return () => (
知识点目录
{ pointData.active = val }} accordion > {props.data.map((item: any, index: number) => { return ( 0 ? styles.borderTop : ''} isLink={false} title={item.name} name={item.id} > {{ default: () => ( <> {Array.isArray(item?.materialList) && item.materialList.map((n: any) => { return (
{ emit('handleSelect', { itemActive: n.id, tabActive: item.id, tabName: item.name }) }} > {n.name} {/* */}
) })} {Array.isArray(item?.children) && ( { pointData.childActive = val }} accordion > {item?.children.map((child: any) => { return ( {{ default: () => ( <> {Array.isArray(child?.materialList) && child.materialList.map((n: any) => { return (
{ emit('handleSelect', { itemActive: n.id, tabActive: child.id, tabName: child.name }) }} > {n.name} {/* */}
) })} ), icon: () => }}
) })}
)} ), icon: () => }}
) })}
) } })