fix(table): 修复表格尺寸调整问题
This commit is contained in:
parent
fddf862ac6
commit
4a72e607ab
@ -182,6 +182,11 @@ export default {
|
|||||||
this.initDictData();
|
this.initDictData();
|
||||||
this.initSearchData();
|
this.initSearchData();
|
||||||
},
|
},
|
||||||
|
mounted() {
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.resizeTable();
|
||||||
|
});
|
||||||
|
},
|
||||||
watch: {
|
watch: {
|
||||||
'$route.query.refresh': function(newVal) {
|
'$route.query.refresh': function(newVal) {
|
||||||
if (newVal) {
|
if (newVal) {
|
||||||
@ -200,6 +205,13 @@ export default {
|
|||||||
// 移除refresh参数,避免重复刷新
|
// 移除refresh参数,避免重复刷新
|
||||||
this.$router.replace({ query: {} });
|
this.$router.replace({ query: {} });
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
'$route.path': function(newPath, oldPath) {
|
||||||
|
if (newPath === '/example/tsoorder') {
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.resizeTable();
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@ -355,6 +367,15 @@ export default {
|
|||||||
.catch(() => {
|
.catch(() => {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
resizeTable() {
|
||||||
|
const table = this.$refs.table;
|
||||||
|
if (table) {
|
||||||
|
const elTable = table.$refs.JNPFTable || table.$refs.table;
|
||||||
|
if (elTable && elTable.doLayout) {
|
||||||
|
elTable.doLayout();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user