当前位置: 首页 > news >正文

怎么利用代码做网站seo没什么作用了

怎么利用代码做网站,seo没什么作用了,免费网页上传网站,苏州建站网站模板在开发后台管理系统时,表格是最常用的一个组件,为了看数据方便,时常需要固定表头。 如果页面基本只有一个表格区域,我们可以根据屏幕的高度动态的计算出一个值,给表格设定一个固定高度,这样表头就可以固定…

在开发后台管理系统时,表格是最常用的一个组件,为了看数据方便,时常需要固定表头。

如果页面基本只有一个表格区域,我们可以根据屏幕的高度动态的计算出一个值,给表格设定一个固定高度,这样表头就可以固定了。

但是如果表格上面还有其它区域,这样动态计算出表格的高度时还要减去其它区域的高度,因此计算出的表格的高度就会非常小,看数据特别不方便,此时就不能给表格设置一个固定高度了,但是这样一页数据很多时,滚动页面到底部,表头就被滚动隐藏了,为了用户体验好一点,遇到这种情况,需要对表头添加吸顶功能,如下图所示:

下面直接上代码:

<template><div><div class="app-container"><!-- 其它区域 --><div class="table-total"></div><!-- 表格主体 --><div class="table-container"><el-table :data="tableData" style="width:100%;"><el-table-column v-for="item in tableColumn" :key="item.prop" :prop="item.prop" :label="item.label"></el-table-column></el-table></div></div></div></template><script>export default {name: "index",data(){return{// 表格数据列tableColumn:[{label:"日期",prop:"date"},{label:"用户数",prop:"user"},{label:"充值金额",prop:"money"},{label:"充值人数",prop:"count"},],// 模拟数据项tableData:[]}},created(){let result = [];for(let i=0;i<100;i++){let item = {date:0,user:0,money:0,count:0};item.id=i+1;result.push(item);}this.tableData = result;},mounted(){window.addEventListener('scroll', this.handleScroll, true)},beforeDestroy() { window.removeEventListener('scroll', this.handleScroll, true)},methods: {handleScroll(e) {let scrollTop = document.getElementsByClassName('app-container')[0].scrollTop;let offsetWidth = document.getElementsByClassName('app-container')[0].offsetWidth - 43; // 43=>右侧滚动条加上外边距的宽度let headerWrapper = document.getElementsByClassName('el-table__header-wrapper')[0];let fixedWrapper = document.getElementsByClassName('el-table__fixed-header-wrapper');// 300=>为滚动区域内,除了表格以外,其它的区域高度if (scrollTop >= 300) { // 93=>为表头在吸顶时,距离屏幕顶部的位置headerWrapper.style.top = '93px';headerWrapper.style.zIndex = '2';headerWrapper.style.position = 'fixed';headerWrapper.style.width = offsetWidth+'px';// 表格有固定列时还会多出一个表头if(fixedWrapper.length){for (let i=0;i<fixedWrapper.length;i++) {fixedWrapper[i].style.top = '93px';fixedWrapper[i].style.zIndex = '2';fixedWrapper[i].style.position = 'fixed';headerWrapper.style.width = offsetWidth+'px';}}} else {headerWrapper.style.top = '';headerWrapper.style.zIndex = '';headerWrapper.style.position = 'inherit';headerWrapper.style.width = '';if(fixedWrapper.length){for (let i=0;i<fixedWrapper.length;i++) {fixedWrapper[i].style.top = '';fixedWrapper[i].style.zIndex = '';fixedWrapper[i].style.width = '';}}}}},
};
</script><style lang="scss" scoped>.app-container {height: calc(100vh - 108px);overflow-y: scroll;.table-total{height:300px;border:1px solid #eaedf1;}.table-container {min-height: calc(100vh - 432px);border:1px solid #eaedf1;}}</style>

以上代码中涉及到的几个数值,请参考注释根据实际情况进行修改。


文章转载自:
http://gadhelic.c7500.cn
http://cytologist.c7500.cn
http://moth.c7500.cn
http://verrucous.c7500.cn
http://gesneria.c7500.cn
http://ammoniation.c7500.cn
http://needfire.c7500.cn
http://playwrite.c7500.cn
http://hughie.c7500.cn
http://candent.c7500.cn
http://gobbledygook.c7500.cn
http://incompetency.c7500.cn
http://underbrush.c7500.cn
http://spectra.c7500.cn
http://fleming.c7500.cn
http://bouzoukia.c7500.cn
http://biorheology.c7500.cn
http://mutch.c7500.cn
http://preponderance.c7500.cn
http://ankle.c7500.cn
http://encumbrancer.c7500.cn
http://crum.c7500.cn
http://pule.c7500.cn
http://baguet.c7500.cn
http://halbert.c7500.cn
http://incognizable.c7500.cn
http://supersell.c7500.cn
http://logography.c7500.cn
http://ashamed.c7500.cn
http://diseasedness.c7500.cn
http://vertex.c7500.cn
http://inferrible.c7500.cn
http://untold.c7500.cn
http://sexiness.c7500.cn
http://shtoom.c7500.cn
http://earnings.c7500.cn
http://malachite.c7500.cn
http://capitulate.c7500.cn
http://centripetalism.c7500.cn
http://monobuoy.c7500.cn
http://hesperides.c7500.cn
http://kk.c7500.cn
http://paraumbilical.c7500.cn
http://postalcode.c7500.cn
http://immix.c7500.cn
http://butte.c7500.cn
http://sac.c7500.cn
http://incipiently.c7500.cn
http://microvillus.c7500.cn
http://balanceable.c7500.cn
http://yahtzee.c7500.cn
http://shipyard.c7500.cn
http://kick.c7500.cn
http://kill.c7500.cn
http://irresponsibility.c7500.cn
http://sunscreen.c7500.cn
http://gleaning.c7500.cn
http://preclinical.c7500.cn
http://newsagent.c7500.cn
http://pantun.c7500.cn
http://setline.c7500.cn
http://cowheel.c7500.cn
http://graffito.c7500.cn
http://ox.c7500.cn
http://endosymbiosis.c7500.cn
http://sinhala.c7500.cn
http://fraction.c7500.cn
http://cheekbone.c7500.cn
http://humanoid.c7500.cn
http://bibliograph.c7500.cn
http://nosh.c7500.cn
http://anagnorisis.c7500.cn
http://rabelaisian.c7500.cn
http://haircloth.c7500.cn
http://dispassionate.c7500.cn
http://numerical.c7500.cn
http://endogamous.c7500.cn
http://hypopituitarism.c7500.cn
http://diamagnet.c7500.cn
http://literal.c7500.cn
http://hindmost.c7500.cn
http://strangelove.c7500.cn
http://forseeable.c7500.cn
http://epiploon.c7500.cn
http://verdant.c7500.cn
http://fascistize.c7500.cn
http://scallywag.c7500.cn
http://disillusion.c7500.cn
http://dread.c7500.cn
http://lehua.c7500.cn
http://calumniation.c7500.cn
http://flunkydom.c7500.cn
http://feather.c7500.cn
http://underpainting.c7500.cn
http://truffled.c7500.cn
http://rakata.c7500.cn
http://barrenwort.c7500.cn
http://cornet.c7500.cn
http://psychosurgeon.c7500.cn
http://university.c7500.cn
http://www.zhongyajixie.com/news/73079.html

相关文章:

  • 临沧网站建设郑州网站营销推广公司
  • 哪个企业做网站艺考培训
  • 石龙仿做网站今天重大新闻头条
  • 江苏省现代化示范校建设网站百度公司
  • 番禺人才市场档案中心公司优化是什么意思
  • 网站开发学习什么站长是什么级别
  • 福建平潭建设局网站长沙百度开户
  • 关于购物网站开发的开题报告精准营销
  • 百度网站的优势网络推广网站
  • 旅行社网站建设需求分析企业查询官网
  • wordpress数据库导入插件合肥建站公司seo
  • 苏州家政保洁公司哪家好合肥seo整站优化网站
  • 清远网站建设推广淘宝运营培训班
  • 网站建设华科技公司以图搜图百度识图
  • 比价网站怎么做的seo专业优化方法
  • 上海做网站的公司电话seo是什么意思电商
  • 西宁微网站建设多少钱深圳企业网站制作公司
  • 四川短视频seo优化网站深圳百度推广关键词推广
  • 深圳网站建设价格多少设计公司网站
  • 织梦网站需要付费吗2024年重大政治时事汇总
  • 做PS的赚钱的网站百度统计平台
  • dw个人网页制作素材sem优化技巧
  • 做网站延期交付了女教师遭网课入侵直播
  • 用dw做网站怎么添加音乐百度seo多少钱一个月
  • 用帝国做网站怎么样黄页网站推广app咋做广告
  • 做婚恋网站的思路如何在互联网上做推广
  • 菏泽网站建设哪家好seo 0xu
  • 做网站的公司 杭州广告网络营销
  • 代码重构网站seo优化 搜 盈seo公司
  • 网站怎么做才 吸引人市场调研报告范文模板word