Skip to content

Commit

Permalink
Table: Fix scroll Y bug
Browse files Browse the repository at this point in the history
  • Loading branch information
guluan committed Sep 6, 2021
1 parent 50a464e commit f9d4109
Show file tree
Hide file tree
Showing 3 changed files with 17,763 additions and 8 deletions.
83 changes: 76 additions & 7 deletions examples/play/index.vue
Original file line number Diff line number Diff line change
@@ -1,15 +1,84 @@
<template>
<div style="margin: 20px;">
<el-input v-model="input" placeholder="请输入内容"></el-input>
<el-table
:data="tableData"
height="400px"
border
ref="table"
>
<el-table-column
prop="date"
label="日期"
width="180">
</el-table-column>
<el-table-column
prop="name"
label="姓名"
width="180">
</el-table-column>
<el-table-column
prop="address"
label="地址">
</el-table-column>
<el-table-column prop="" width="" label="操作">
<template slot-scope="{row}">
<el-button size="mini" type="success" @click="handleClick">添加</el-button>
<div v-if="showText">
我是添加的内容<br>
我是添加的内容<br>
我是添加的内容<br>
我是添加的内容<br>
我是添加的内容<br>
我是添加的内容<br>
我是添加的内容<br>
</div>
</template>
</el-table-column>
</el-table>
</div>
</template>

<script>
export default {
data() {
return {
input: 'Hello Element UI!'
};
export default {
data() {
return {
// domHeight: '',
showText: false,
tableData: [{
date: '2016-05-02',
name: '王小虎',
province: '上海',
city: '普陀区',
address: '上海市普陀区金沙江路 1518 弄',
zip: 200333,
tag: ''
}, {
date: '2016-05-04',
name: '王小虎',
province: '上海',
city: '普陀区',
address: '上海市普陀区金沙江路 1517 弄',
zip: 200333,
tag: '公司'
}]
};
},
mounted() {
this.init()
},
computed:{
domHeight() {
return document.querySelector('.el-table__body').offsetHeight;
}
};
},
methods: {
init() {
// this.domHeight = document.querySelector('.el-table__body').offsetHeight;
},
handleClick(row) {
this.showText = !this.showText
this.$refs['table'].updateScrollY()
}
}
};
</script>
Loading

0 comments on commit f9d4109

Please sign in to comment.