VM115148 vue.esm.js:1896 Error: [ElementForm]unpected width at VueComponent.getLabelWidthIndex
- Dominant language
- Vue
- Stars
- 54k
- Forks
- 14.4k
- PR merge metrics
- No merged PRs in 30d
Description
Hi! 👋
Firstly, thanks for your work on this project! 🙂
Today I used [patch-package](https://github.com/ds300/patch-package) to patch `element-ui@2.15.7` for the project I'm working on.
Here is the diff that solved my problem:
```diff
diff --git a/node_modules/element-ui/packages/form/src/label-wrap.vue b/node_modules/element-ui/packages/form/src/label-wrap.vue
index d263f7d..a59023a 100644
--- a/node_modules/element-ui/packages/form/src/label-wrap.vue
+++ b/node_modules/element-ui/packages/form/src/label-wrap.vue
@@ -32,7 +32,8 @@ export default {
getLabelWidth() {
if (this.$el && this.$el.firstElementChild) {
const computedWidth = window.getComputedStyle(this.$el.firstElementChild).width;
- return Math.ceil(parseFloat(computedWidth));
+ return Math.ceil(parseFloat(computedWidth) || 0);
} else {
return 0;
}
```
This issue body was [partially generated by patch-package](https://github.com/ds300/patch-package/issues/296).
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.