Element: [Bug Report] select remote remote search how to set the default display is value, the submitted value is ID?

Created on 8 Nov 2018  ·  2Comments  ·  Source: ElemeFE/element

Element UI version

2.4.8

OS/Browsers version

Mac OS、Chrome

Vue version

2.5.17

Reproduction Link

https://jsfiddle.net/fantasygm/sujkf2y3/1/

Steps to reproduce

在编辑表单的时候,由于因为

What is Expected?

由于初始化给的数据格式是{"id":1,"value":"我是值1"},需求上希望显示的是文本value,同时编辑提交的数据是id,如:{"parentAgent":1}

What is actually happening?

实际显示的是要么是 id,要么是value。请问,有没有办法让表单显示的是value,并且form存的值是id,就与最初选择候选集合的时候是一样的效果?

All 2 comments

Translation of this issue:

Element UI version
2.4.8

OS/Browsers version
Mac OS, Chrome

Vue version
2.5.17

Reproduction Link
https://jsfiddle.net/fantasygm/sujkf2y3/1/

Steps to reproduce
In the edit form, because of

What is Expected?
Due to the initialization of data format is {"Id": 1 "value": "I'm 1"}, demand hope is shown in the text value, editor of the ID data is submitted at the same time, such as: {"parentAgent": 1}

What is actually happening?
The actual display is either ID or value, there is no way that is value, but the final value is ID, the effect was a root began to choose the candidate set as.

两种思路吧:

  1. 使用 value-key 试试。
  2. 或者你把提交的数据转换一下。
Was this page helpful?
0 / 5 - 0 ratings