xgqfrms™, xgqfrms® : xgqfrms's offical website of cnblogs! xgqfrms™, xgqfrms® : xgqfrms's offical website of GitHub!

vue table dynamic column resize bug All In One

vue table dynamic column resize bug All In One

elememt-ui 表格渲染错位

doLayout 对 Table 进行重新布局。当 Table 或其祖先元素由隐藏切换为显示时,可能需要调用此方法

https://element.eleme.io/#/zh-CN/component/table#table-methods

    async getTableData () {
        this.columns = [];
        this.gridData = [];
        let params = this.getParams;
        this.tableLoading = true;
        const res = await Table2AdCustomSubService.getDayDetailData(params).finally(() => {
          this.tableLoading = false;
        });
        const {header, data} =  res?.data?.data ?? {};
        this.heads = res.data.data.header;
        this.data = res.data.data.data;
        this.$nextTick(() => {
            // this.autoResizeTable();
            // 获得数据后,立刻更新 DOM
            this.$refs.tableRef.doLayout();
        });
    },

refs



©xgqfrms 2012-2020

www.cnblogs.com/xgqfrms 发布文章使用:只允许注册用户才可以访问!

原创文章,版权所有©️xgqfrms, 禁止转载 🈲️,侵权必究⚠️!


posted @ 2022-02-08 14:26  xgqfrms  阅读(205)  评论(3编辑  收藏  举报