We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
1.4.11
mac chrome
https://github.com/vueComponent/ant-design-vue
直接看源码
// lib/checkbox/Group.js export default { ... methods: { ... getOptions: function getOptions() { var options = this.options, $scopedSlots = this.$scopedSlots; return options.map(function (option) { if (typeof option === 'string') { return { label: option, value: option }; } var label = option.label; if (label === undefined && $scopedSlots.label) { label = $scopedSlots.label(option); } return (0, _extends3['default'])({}, option, { label: label }); }); } } }
this.$scopedSlots.label 的优先级应大于 option.label. 这样在就能在 slot-scope 里面拿到 label 值加以改造.
this.$scopedSlots.label 被 option.label 覆盖, 不能基于 label 字段进行改造, 用起来有些反直觉.
或者 label 支持提供一个 customRender, 这样也不用费事用 slot 了. 若无计划调整, 也应在文档相应处进行注明.
The text was updated successfully, but these errors were encountered:
options: [{value: 'a'}]
这样配置就可以了
Sorry, something went wrong.
@tangjinzhou 我知道这样配置ok, 只是觉得这个优先级有些反直觉. 或说文档看不出来需要到源码才能找到.
建议文档注明这一点, 提示: slot="label" slot-scope="option" 定制的 label 会被 option.label 覆盖.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
No branches or pull requests
Version
1.4.11
Environment
mac chrome
Reproduction link
https://github.com/vueComponent/ant-design-vue
Steps to reproduce
直接看源码
What is expected?
this.$scopedSlots.label 的优先级应大于 option.label. 这样在就能在 slot-scope 里面拿到 label 值加以改造.
What is actually happening?
this.$scopedSlots.label 被 option.label 覆盖, 不能基于 label 字段进行改造, 用起来有些反直觉.
Additional comment
或者 label 支持提供一个 customRender, 这样也不用费事用 slot 了.
若无计划调整, 也应在文档相应处进行注明.
The text was updated successfully, but these errors were encountered: