superzhoudalu / blogexample Goto Github PK
View Code? Open in Web Editor NEW博客代码示例
Home Page: https://juejin.cn/user/4494459264575927/posts
博客代码示例
Home Page: https://juejin.cn/user/4494459264575927/posts
我加上了adaptive部分的代码之后成功的实现了调整浏览器大小时表格也可以随之变化。
但我有一些元素会在使用中途被隐藏,这时候我也想让table自动调整大小,应该怎么触发呢?
我尝试了window.dispatch(new Event("size")),但是没有成功。
代码大概如下,
把代码全局引入
<el-table height="100px" :data="tableData" v-adaptive="{bottomOffset: 60}"
data(){
return {
tableData:[]
}},
mounted(){
this.getList()
},
methods:{
async getList(){
const d= await xxx()
this.tableData = d
}
}
在代码调试中,第一次是有设置 高度的,但随后数据渲染上去,高度变回 100px ,扣除列头,table body 只剩55px ,需要触发resize才有效。
用原生指令height或者maxHeight 设置了高度后,表头是固定的,在实现过程中,发现按您的这样设置,无法固定表头,请问这个问题需要怎么解决呢
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.