- Business requirements need to be highly adaptive to el-table
- some related codes
el-table part
<el-table
style="width: 100%"
ref="topictable"
:height="tableHeight"
:data="order_goodsList"
hightlight-current-row
@row-click="handle"
>
</el-table>
script part
<script>
export default {
data() {
return {
// table
tableHeight: 300
};
},
mounted() {
console.log(window.innerHeight)
console.log(this.$refs.topictable.$el)
console.log(this.$refs.topictable.$el.offsetTop)
this.tableHeight =
window.innerHeight - this.$refs.topictable.$el.offsetTop - 50;
console.log(this.tableHeight)
},
- prints the log through the console, and the tableHeight content changes, but the value of el-table is still the initial value.
- result