fix(table): 修复表格尺寸调整问题

This commit is contained in:
zxy 2026-04-21 11:52:30 +08:00
parent fddf862ac6
commit 4a72e607ab

View File

@ -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>