Skip to content
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

Form hide label props 隱藏表單label #858

Closed
Proladon opened this issue Aug 13, 2021 · 3 comments · Fixed by #865
Closed

Form hide label props 隱藏表單label #858

Proladon opened this issue Aug 13, 2021 · 3 comments · Fixed by #865
Assignees
Labels
feature request New feature or request

Comments

@Proladon
Copy link

Proladon commented Aug 13, 2021

This function solves the problem (这个功能解决的问题)

更客製能符合更多使用情境
有時候不希望顯示label� 但目前label沒有顯示的開關,會一直佔用grid的一個高度欄位
與input的區別是,在不希望顯示label的情境下,仍有表單驗證功能

Expected API (期望的 API)

<n-form :hide-label="true" />
@github-actions github-actions bot added the feature request New feature or request label Aug 13, 2021
@Volankey
Copy link
Collaborator

Volankey commented Aug 13, 2021

需要实现 <n-form :show-label="false" />

@kev1nzh37 kev1nzh37 self-assigned this Aug 13, 2021
kev1nzh37 pushed a commit to kev1nzh37/naive-ui that referenced this issue Aug 13, 2021
kev1nzh37 pushed a commit to kev1nzh37/naive-ui that referenced this issue Aug 13, 2021
@kev1nzh37
Copy link
Collaborator

更客製能符合更多使用情境
有時候不希望顯示label� 但目前label沒有顯示的開關,會一直佔用grid的一個高度欄位
與input的區別是,在不希望顯示label的情境下,仍有表單驗證功能

在目前的版本2.16.2中,传入 false 会不展示 label 的高度栏位。

 // 正常情况
  <n-form-item label="姓名" path="user.name">
    <n-input v-model:value="formValue.user.name" placeholder="输入姓名" />
  </n-form-item>

// 不需要 label 和占位时 
  <n-form-item :label="false" path="user.name">
    <n-input v-model:value="formValue.user.name" placeholder="输入姓名" />
  </n-form-item>

@XieZongChen XieZongChen linked a pull request Aug 13, 2021 that will close this issue
@07akioni
Copy link
Collaborator

更客製能符合更多使用情境
有時候不希望顯示label� 但目前label沒有顯示的開關,會一直佔用grid的一個高度欄位
與input的區別是,在不希望顯示label的情境下,仍有表單驗證功能

在目前的版本2.16.2中,传入 false 会不展示 label 的高度栏位。

 // 正常情况
  <n-form-item label="姓名" path="user.name">
    <n-input v-model:value="formValue.user.name" placeholder="输入姓名" />
  </n-form-item>

// 不需要 label 和占位时 
  <n-form-item :label="false" path="user.name">
    <n-input v-model:value="formValue.user.name" placeholder="输入姓名" />
  </n-form-item>

需要保证 show-label=false 的时候 label 也不占位

kev1nzh37 pushed a commit to kev1nzh37/naive-ui that referenced this issue Aug 14, 2021
kev1nzh37 pushed a commit to kev1nzh37/naive-ui that referenced this issue Aug 14, 2021
kev1nzh37 pushed a commit to kev1nzh37/naive-ui that referenced this issue Aug 17, 2021
kev1nzh37 pushed a commit to kev1nzh37/naive-ui that referenced this issue Aug 18, 2021
kev1nzh37 pushed a commit to kev1nzh37/naive-ui that referenced this issue Aug 18, 2021
kev1nzh37 pushed a commit to kev1nzh37/naive-ui that referenced this issue Aug 19, 2021
kev1nzh37 pushed a commit to kev1nzh37/naive-ui that referenced this issue Aug 19, 2021
07akioni added a commit that referenced this issue Aug 19, 2021
* feat(form): add show-label prop and test (#858)

* docs(form): add show-label doc and fix form item label desc (#858)

* Update CHANGELOG.en-US.md

Co-authored-by: Yugang Cao <[email protected]>

* Update CHANGELOG.zh-CN.md

Co-authored-by: Yugang Cao <[email protected]>

* feat(form): rewrite show-label and add tests (#858)

* docs(form): add show-label demo (#858)

* feat(form): change show-label computed  (#858)

* feat(form): fix show-label (#858)

* feat(form): fix bug (#858)

* feat(form): update show-label scripts (#858)

* docs(form): update show-label order and label description (#858)

* Apply suggestions from code review

Co-authored-by: kev1nzh <[email protected]>
Co-authored-by: Yugang Cao <[email protected]>
Co-authored-by: kev1nzh_ark <[email protected]>
Co-authored-by: 07akioni <[email protected]>
rhengles pushed a commit to arijs/naive-ui that referenced this issue Oct 20, 2021
* feat(form): add show-label prop and test (tusen-ai#858)

* docs(form): add show-label doc and fix form item label desc (tusen-ai#858)

* Update CHANGELOG.en-US.md

Co-authored-by: Yugang Cao <[email protected]>

* Update CHANGELOG.zh-CN.md

Co-authored-by: Yugang Cao <[email protected]>

* feat(form): rewrite show-label and add tests (tusen-ai#858)

* docs(form): add show-label demo (tusen-ai#858)

* feat(form): change show-label computed  (tusen-ai#858)

* feat(form): fix show-label (tusen-ai#858)

* feat(form): fix bug (tusen-ai#858)

* feat(form): update show-label scripts (tusen-ai#858)

* docs(form): update show-label order and label description (tusen-ai#858)

* Apply suggestions from code review

Co-authored-by: kev1nzh <[email protected]>
Co-authored-by: Yugang Cao <[email protected]>
Co-authored-by: kev1nzh_ark <[email protected]>
Co-authored-by: 07akioni <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants