Vue + el-tableは、画面サイズに応じてmax-heightプロパティを動的に設定し、複数のテーブルの高さに適応するのに適しており、スクロールバーが表示されます

<el-table ref = "table":data = "info":span-method = "colspanMethod":max-height = "tableHeight">
    <el-table-column type = "selection" width = "40">
    < / el-table-column>
    <el-table-column label = "序号" width = "60">
        <template slot-scope = "scope">
            { {scope。$ index + 1}}
        </ template>
    </ el-table-column>
    <el-table-column label = "単位" width = "260">
        <template slot-scope = "scope">
            { {scope.row.ORGNAME}}
        </ template>
    </ el-テーブル-列>
    <el-table-column label = "文件名" width = "260">
        <template slot-scope = "scope">
            { {scope.row.jyFile.FILE_NAME}}
        </ template>
    </ el-table-column>
</ el-table>

    Mounted :function(){ this.tableHeight = window.innerHeight-this。$ refs.table。$ el.offsetTop-50; //window.innerHeight     :ブラウザの使用可能な高さ//this.$refs.table.$     el .offsetTop:ブラウザからのテーブルの高さ     // 50後ろ:必要に応じて空になった高さ、自分で調整}




おすすめ

転載: blog.csdn.net/m13302979400/article/details/92796349