import { NCollapse, NCollapseItem } from 'naive-ui'; import { computed, defineComponent, ref, watch } from 'vue'; import CardType from '/src/components/card-type'; import styles from './index.module.less'; export default defineComponent({ name: 'source-list', props: { knowledgePointList: { type: Array, default: () => [] }, activeItem: { type: Object, default: () => ({}) }, /** 当前播放的是第几个知识点组 */ courseActiveIndex: { type: Number, default: 0 } }, emits: ['confirm'], setup(props, { emit }) { const parentIndex = ref(props.courseActiveIndex); watch( () => props.courseActiveIndex, () => { parentIndex.value = props.courseActiveIndex; } ); const childIndex = computed(() => { let index = 0; props.knowledgePointList.forEach((item: any) => { item.list.forEach((child: any, j: number) => { if (child.id === props.activeItem.id) { index = j; } }); }); return index; }); return () => (
{item.title}