Skip to content
This repository has been archived by the owner on Mar 15, 2018. It is now read-only.

select 类的组件数据回显问题 #5

Open
xxapp opened this issue Jul 27, 2017 · 0 comments
Open

select 类的组件数据回显问题 #5

xxapp opened this issue Jul 27, 2017 · 0 comments

Comments

@xxapp
Copy link
Owner

xxapp commented Jul 27, 2017

就比如 select 组件,修改表单,需要根据后台返回的 id 显示 name。

如果是本地数据,遍历一次就可以。

如果是远程数据,问题就复杂得多了,一种办法是让后端返回表单数据得时候,把 name 也带上,另一种办法是新增一个查询接口,每次需要显示得时候去查询。

解决办法都需要后端配合,前端要做得事情就是把 name 取出来显示,手动在业务代码里面写是很麻烦的,最好是能封装到组件中做,那就相当完美了。

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant