Skip to content

Commit

Permalink
修复form的label-width为auto时,在IE 11下input被换行的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
lyswhut committed Nov 2, 2021
1 parent 5390f40 commit c85867a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/form/src/label-wrap.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ export default {
methods: {
getLabelWidth() {
if (this.$el && this.$el.firstElementChild) {
const computedWidth = window.getComputedStyle(this.$el.firstElementChild).width;
if (this.$el) {
const computedWidth = window.getComputedStyle(this.$el).width;
return Math.ceil(parseFloat(computedWidth));
} else {
return 0;
Expand Down

0 comments on commit c85867a

Please sign in to comment.