Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
340 views
in Technique[技术] by (71.8m points)

el-tree异步搜索的问题

默认的tree需要懒加载

<el-tree :props="props" :load="loadNode" lazy>
</el-tree>

组件自带的过滤是在当前数据里匹配的,但是tree是懒加载的,需求搜索的时候是异步在所有数据中查询的,因为懒加载的tree也没有data,请问我怎么把搜索回来的数据放进去?

http://jsrun.net/3G2Kp/edit


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

已解决,搜索的时候重新调用loadData 判断是否有搜索条件,走不同的接口,清空tree的data


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
...