❤️ 父子传参
💡 v3 组件传参设置默认值
/*
* @defineProps 获取传来的值
* @withDefaults 设置默认值❤️🔑 🔩 ⚡️ ⚙💡
*
* */
import {defineProps, ref,withDefaults} from "vue";
import type {typePlanList} from './type'
interface Props {
planList: typePlanList[]
}
const props = withDefaults(defineProps<Props>(), {
planList: () => [],
})
🔑 v3 KeepAlive用法
<router-view v-slot="{ Component }">
<KeepAlive>
<component :is="Component" />
</KeepAlive>
</router-view>