当前位置: 代码迷 >> 综合 >> vue实现递归组件
  详细解决方案

vue实现递归组件

热度:71   发布时间:2023-10-10 19:30:26.0

父组件

<loongDropDownBox :keyVal="keyVal" :menuData="menuData"></loongDropDownBox>

组件

<template><ul style="width: 100%"><li v-for="(item,index) in menuData " :key="index"><p>{
   {item.name}}</p><loongDropDownBox :keyVal="keyVal" :menuData="item.children"></loongDropDownBox></li></ul>
</template>

 

  相关解决方案