2***@qq.com
2***@qq.com
  • 发布:2018-12-06 15:10
  • 更新:2020-12-14 14:35
  • 阅读:4081

uniapp 组件如何递归?

分类:HBuilderX

树结构排版在开发过程中还是很常见的,普遍都是使用递归组件的方法,但是在uniapp中递归的时候只显示了第一级结构,后面的结构就显示不出来了,但是console的时候执行是正确的。

<view class="tree-li">  
    <view class="tree-div">  
        {{lists.name}}  
    </view>  

    <view v-if="isFolder">  
        <client_tree :lists="lists.children">{{lists.children.name}}</client_tree>  
    </view>  
</view>  

export default {  
    name: "client_tree",  
    props: {  
        lists: Object,  
    },  
    components: {},  
    data: function() {  
        return {  

        };  
    },  
    computed: {  
        isFolder: function () {  
            return this.lists.children && this.lists.children.length;  
        }  
    }  
}
2018-12-06 15:10 负责人:无 分享
已邀请:
t***@163.com

t***@163.com - 80后

我也遇到了这个问题,在微信小程序和安卓app下都不支持递归好像,h5下兼容求解决办法!

8***@qq.com

8***@qq.com - 842022895

同求解决办法

名字都被占用了

名字都被占用了

同求办法

1***@qq.com

1***@qq.com - 90后IT男

me too

没得好名字

没得好名字 - 90后前端妹子一枚

请问解决了吗

该问题目前已经被锁定, 无法添加新回复