select icon indicating copy to clipboard operation
select copied to clipboard

feat: add alternative label

Open SCWR opened this issue 3 years ago • 6 comments

增加一个备用的 label 渲染 在 存在表单还原场景 已选择中项有后端返回 key 但是对应选项已经被删除了 导致查找不到对应选项 希望能通过底层提供一个备用 label 来处理 避免上层再次处理 value

SCWR avatar Mar 14 '22 10:03 SCWR

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/react-component/select/8EFx1MGPtiJVAyTGwVmCoFbHAWf6
✅ Preview: https://select-git-fork-scwr-master-react-component.vercel.app

vercel[bot] avatar Mar 14 '22 10:03 vercel[bot]

请问有进展吗

SCWR avatar Apr 27 '22 07:04 SCWR

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
select ✅ Ready (Inspect) Visit Preview Apr 27, 2022 at 8:04AM (UTC)

vercel[bot] avatar Apr 27 '22 08:04 vercel[bot]

image 本地调用命令时,会报以上错误。 需要配置什么才能通过呢? @afc163

SCWR avatar Apr 27 '22 08:04 SCWR

清除 node_modules 重装,另外这个和 labelInValue 区别是什么?看起来 labelInValue HOC 一下即可?

zombieJ avatar Apr 28 '22 08:04 zombieJ

清除 node_modules 重装,另外这个和 labelInValue 区别是什么?看起来 labelInValue HOC 一下即可?

清除了node_modules 重装会报这个错误

image

实现相同功能,当然可以有很多种方式。但是 labelInValue 只是把逻辑提前到上层处理,还是做了一层遍历的操作 而且并不是个简便的方式 我看了内部实现 发现 有一个 convert2LabelValues 的操作,也有遍历操作,这样的话,把上述操作放到这里处理,可以解决 80% 的场景,也提高一点点性能。也比较方便易用

现在有个场景就是 失效选项 会出现直接显示 id 的情况

SCWR avatar Apr 29 '22 03:04 SCWR