Giter VIP home page Giter VIP logo

Comments (5)

chenshuai2144 avatar chenshuai2144 commented on July 20, 2024

有个配置叫labelinvalue 你看一下

from pro-components.

jasonwang1109 avatar jasonwang1109 commented on July 20, 2024

有个配置叫labelinvalue 你看一下

当select 里的值不修改的时候, labelinvalue 不起效果,transform={(value, namePath, allValues)=>{} 里的value 是label ,只有下拉框里选一个值, value 才会变成{lable:'', value:''},这个属性才会有效果

from pro-components.

fnoopv avatar fnoopv commented on July 20, 2024

https://codesandbox.io/p/sandbox/modal-biao-dan-forked-25dgx2

试了一下,没问题啊,不重新选择的情况下, select字段transform打印的是{label: '',value''},最后提交打印的也是{label: '',value''}

from pro-components.

jasonwang1109 avatar jasonwang1109 commented on July 20, 2024

https://codesandbox.io/p/sandbox/modal-biao-dan-forked-25dgx2

试了一下,没问题啊,不重新选择的情况下, select字段transform打印的是{label: '',value''},最后提交打印的也是{label: '',value''}

因为你初始化的时候,给的结构里包含了lable, value select: {
label: "测试1",
value: "test1",
},

我服务端返回的结构是 let initialValues = {
other:"",
display_name:"dispaly name",
display_id:"123",
}, select 的 name 等于 display_name,display_id 等于 select value,

服务端不能直接提供这样的结构 select:{
label: "dispaly name",
value: "123",
}

不知道客户端是否有简单方式可以处理这种情况?

from pro-components.

fnoopv avatar fnoopv commented on July 20, 2024

我能想到的解决颁发:

  1. 获取到后端返回值后重新整理一下,再赋值给initValues
  2. 还是目前这样赋值给initValues,然后valueEnme或者request给组件提供包含当前value的选择项,这样也没问题

from pro-components.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.