Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

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

el-cascader相关问题

用来做地区级联,数据是后端一次性返回的。数组结构类似于下图
image.png
需求:在选中地区之后不仅要获得id,还要获得lat/lon经纬度用来存入数据库
目前的做法是:取得id后,将id和地区数组进行递归遍历取得lat/lon
实现了功能但担心性能问题,不知道能不能在选中城市的时候就直接取得id/lat/lon


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

1 Answer

0 votes
by (71.8m points)

可以利用框架自带的getCheckedNodes方法取得选中的node节点,然后从中取出所需的经纬度即可


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...