Commit 1ff01a77 authored by 杨奕's avatar 杨奕 Committed by GitHub

Table: fix an undefined issue in ssr (#11109)

parent 3d5f9ef0
...@@ -232,10 +232,10 @@ ...@@ -232,10 +232,10 @@
removeClass(this.getInputElement(), 'invalid'); removeClass(this.getInputElement(), 'invalid');
return true; return true;
}, },
getFistFocus() { getFirstFocus() {
const $btns = this.$el.querySelector('.el-message-box__btns .el-button'); const btn = this.$el.querySelector('.el-message-box__btns .el-button');
const $title = this.$el.querySelector('.el-message-box__btns .el-message-box__title'); const title = this.$el.querySelector('.el-message-box__btns .el-message-box__title');
return $btns && $btns[0] || $title; return btn || title;
}, },
getInputElement() { getInputElement() {
const inputRefs = this.$refs.input.$refs; const inputRefs = this.$refs.input.$refs;
...@@ -264,7 +264,7 @@ ...@@ -264,7 +264,7 @@
}); });
} }
this.focusAfterClosed = document.activeElement; this.focusAfterClosed = document.activeElement;
messageBox = new Dialog(this.$el, this.focusAfterClosed, this.getFistFocus()); messageBox = new Dialog(this.$el, this.focusAfterClosed, this.getFirstFocus());
} }
// prompt // prompt
......
...@@ -112,6 +112,7 @@ class TableLayout { ...@@ -112,6 +112,7 @@ class TableLayout {
} }
updateColumnsWidth() { updateColumnsWidth() {
if (Vue.prototype.$isServer) return;
const fit = this.fit; const fit = this.fit;
const bodyWidth = this.table.$el.clientWidth; const bodyWidth = this.table.$el.clientWidth;
let bodyMinWidth = 0; let bodyMinWidth = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment