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: label-width supports width auto #14944

Merged
merged 3 commits into from
Apr 3, 2019
Merged

Form: label-width supports width auto #14944

merged 3 commits into from
Apr 3, 2019

Conversation

ziyoung
Copy link
Contributor

@ziyoung ziyoung commented Apr 2, 2019

Please make sure these boxes are checked before submitting your PR, thank you!

  • Make sure you follow Element's contributing guide (中文 | English | Español | Français).
  • Make sure you are merging your commits to dev branch.
  • Add some descriptions and refer relative issues for you PR.

@element-bot
Copy link
Member

element-bot commented Apr 2, 2019

Deploy preview for element ready!

Built with commit c6024f1

https://deploy-preview-14944--element.netlify.com

@ziyoung ziyoung changed the title [WIP]Form: label-width support auto Form: label-width supports width auto Apr 3, 2019
@ziyoung ziyoung merged commit a408b3d into ElemeFE:dev Apr 3, 2019
@de1ck
Copy link

de1ck commented Apr 3, 2019

@ziyoung
When I use label-width: auto
[Vue warn]: Error in beforeDestroy hook: "Error: [ElementForm]unpected width "
found in

---> at packages/form/src/label-wrap.vue

@Shu-Ji
Copy link

Shu-Ji commented May 30, 2019

@ziyoung When I use label-width="auto" on el-form which is located in an el-tab, will also get the error

[ElementForm]unpected width 

There is a demo:

https://codepen.io/bh20077/pen/NVObdd

Main code from the demo:

#app
  p
    el-button(type="primary" @click="toggleCard") 隐藏
    
  p 请打开控制台,然后点击上面的按钮,将会隐藏下面的 card,此时在控制台会报错。经过排查是 el-form 上面的 label-width = "auto" 属性导致的,如果不设置或者设置居 label-width="100px" 就不会报错
  
  el-card(v-if="show_card")
    //- 直接写在这里面也不会报错的,但是将 form 写到下面的 el-tabs 里面就会报错
    //- el-form(label-width="auto")
    //-       el-form-item
    //-         el-form-item(label="任务名称")
    //-             el-input(v-model="task_name" type="text" placeholder="请填写任务名称")
    
    el-tabs(stretch)
      el-tab-pane(label="基本信息")
        //- 这里的 label-width = "auto" 在点击按钮后的时候会报错
        el-form(label-width="auto")
          el-form-item
            el-form-item(label="任务名称")
                el-input
      el-tab-pane(label="运行参数") 运行参数

weisiren168 pushed a commit to weisiren168/element that referenced this pull request Jun 20, 2019
@kooriookami
Copy link

image
Use label-width="auto" get error.
I got this error when I close el-form, ' [ElementForm]unpected width '.

@VanLiuZhi
Copy link

I also encountered this problem, although it did not affect, but there was an error.Hope to fix this problem

@ziyoung
Copy link
Contributor Author

ziyoung commented Aug 23, 2019

I also encountered this problem, although it did not affect, but there was an error.Hope to fix this problem

@VanLiuZhi Please create a new issue.

gd4Ark added a commit to gd4Ark/vue-ele-form that referenced this pull request Oct 24, 2019
gd4Ark added a commit to gd4Ark/vue-ele-form that referenced this pull request Oct 24, 2019
gd4Ark added a commit to gd4Ark/vue-ele-form that referenced this pull request Oct 24, 2019
lzq4047 pushed a commit to lzq4047/element that referenced this pull request May 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants