<template>
<div id="app">
//引用组件,将数据动态传递给组件
<Tree :list='list'/>
</div>
</template>
export default {
components:{
Tree,//注册组件
},
data(){
return {
//递归组件的数据
list:[{
data:'数据1',
open:true,
id:1,
children:[{
data:'数据1-1',
open:true,
id:2,
children:[{
data:'数据1-1-1',
open:true,
id:3,
}]
},{
data:'数据1-2',
open:true,
id:4
}]
},{
data:'数据2',
open:true,
id:5,
children:[{
data:'数据2-1',
open:true,
vue递归组件的增删改
最新推荐文章于 2025-03-25 08:00:00 发布