diff --git a/src/mixins/tableHeightMixin.js b/src/mixins/tableHeightMixin.js new file mode 100644 index 00000000..ad23d16e --- /dev/null +++ b/src/mixins/tableHeightMixin.js @@ -0,0 +1,20 @@ +export default { + data() { + return { + tableH: this.tableHeight(260), + }; + }, + created() { + this.tableH = this?.heightNum ? this.tableHeight(this.heightNum) : this.tableHeight(260); + window.addEventListener('resize', this._setTableHeight); + }, + destroyed() { + window.removeEventListener('resize', this._setTableHeight); + }, + methods: { + _setTableHeight() { + this.tableH = this?.heightNum ? this.tableHeight(this.heightNum) : this.tableHeight(260); + // this.tableH = this.tableHeight(260); + }, + }, +}; diff --git a/src/views/devConfig/quality/qualityInspectionType/index.vue b/src/views/devConfig/quality/qualityInspectionType/index.vue index 78583e8a..a433236b 100644 --- a/src/views/devConfig/quality/qualityInspectionType/index.vue +++ b/src/views/devConfig/quality/qualityInspectionType/index.vue @@ -12,7 +12,8 @@ :page="queryParams.pageNo" :limit="queryParams.pageSize" :table-data="list" - @emitFun="handleEmitFun"> + @emitFun="handleEmitFun" + :max-height="tableH">