element中表格高度怎么自适应浏览器窗口高度显示?

    技术2022-07-13  69

    给你来个传送门的demo:vue-template

    //store 里的缓存 const clientHeight = document.documentElement.clientHeight - 105; //单页面的引用 clientHeight() { return this.$store.state.clientHeight - 115; }

    //el-table的属性 :max-height="clientHeight"

    监听浏览器窗口高度变化

    mounted() { const that = this; window.onresize = function temp() { that.$store.commit( "setHeight", document.documentElement.clientHeight - 105 ); }; }

     

    Processed: 0.027, SQL: 9