提问:为什么在vscode上, v-for="item in list"的list会提醒(property) list?: ColumnProps[] | undefined,我断言了的呀
<template>
<ul>
<li v-for="item in list" :key="item.id">
<img :src="item.avatar" alt="作者头像">
<h5>{{ item.title }}</h5>
<p>{{ item.description }}</p>
<a href="#">进入专栏</a>
</li>
</ul>
</template>
<script lang="ts">
import { defineComponent, PropType } from 'vue'
export interface ColumnProps {
id: string;
title: string;
avatar: string;
description: string;
}
export default defineComponent({
name: 'ColumnList',
props: {
list: {
type: Array as PropType<ColumnProps[]>,
requried: true
}
},