Skip to content

feat: 扩展通过 name/prop 来设置 id 的写法 #216

New issue

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

Merged
merged 2 commits into from
Aug 6, 2021
Merged

Conversation

levy9527
Copy link
Contributor

@levy9527 levy9527 commented Aug 6, 2021

Why

为了符合直觉!为了效率!

Test

yes,unit test。

Docs

no

@levy9527 levy9527 changed the title Feat/name or prop feat: 扩展通过 name/prop 来设置 id 的写法 Aug 6, 2021
@auto-add-label auto-add-label bot added the enhancement New feature or request label Aug 6, 2021
@netlify
Copy link

netlify bot commented Aug 6, 2021

✔️ Deploy Preview for el-form-renderer ready!

🔨 Explore the source changes: 4eb486e

🔍 Inspect the deploy log: https://app.netlify.com/sites/el-form-renderer/deploys/610ce7b40281a6000931d5c5

😎 Browse the preview: https://deploy-preview-216--el-form-renderer.netlify.app/

@levy9527 levy9527 merged commit a91c6d7 into dev Aug 6, 2021
function setItemId(item) {
if (item.id) return
// name 是符合表单项直觉的命名; prop 是为了与 element 的 table 的 columns 匹配
item.id = item.name || item.prop
Copy link
Contributor

@yolofit yolofit Aug 6, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里取值优先级建议对调一下,优先prop > name, 避免用户已设置content item name,导致出错

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants