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

ins做甜品网站怎么做网站教程视频

ins做甜品网站,怎么做网站教程视频,便宜做网站靠谱吗,网站提现功能开发解决方法 在页面table上添加id,动态计算每页table的最大高度 ,将高度保存在store中,每次切换路由时进行计算。 文章目录 解决方法前言一、页面table使用二、store状态库1.引入库 效果 前言 提示:状态管理使用的是pinia,用法参考…

解决方法

在页面table上添加id,动态计算每页table的最大高度 ,将高度保存在store中,每次切换路由时进行计算。

文章目录

  • 解决方法
  • 前言
  • 一、页面table使用
  • 二、store状态库
    • 1.引入库
  • 效果

前言

提示:状态管理使用的是pinia,用法参考简单学习pinia

  1. 项目目录
    在这里插入图片描述

一、页面table使用

  1. 添加:max-height,和id
<el-table :max-height="tableHeightStore.height" id="elTableId" ><el-table-column type="selection" width="30" align="center" /><el-table-column label="标题" fixed align="center" prop="title" width="180" />
</el-table>
  1. js部分,引入高度tableHeightStore.height,计算高度方法useTableHeightStore().setTableHeight()
<script setup name="Activity">import useTableHeightStore from '@/store/modules/table'const tableHeightStore = useTableHeightStore()onActivated(() => {useTableHeightStore().setTableHeight()})onMounted(() => {useTableHeightStore().setTableHeight()})
</script>

二、store状态库

1.引入库

代码如下(table.js):

const useTableHeightStore = defineStore('table-height',{state: () => ({height: 500,//默认高度}),getters:{},actions:{setHeight(height) {this.height=height//高度赋值},setTableHeight() {//计算高度:窗口高度-表格距离顶部距离-固定高度(底部页码高度)this.height= window.innerHeight -document.getElementById("elTableId").getBoundingClientRect().top - 52;//问题:在浏览器窗口缩放90%时,table表的滚动条会消失(max-height丢失),解决:操作dom添加document.querySelector('#elTableId .el-scrollbar__wrap').style.maxHeight = this.height - 40 + "px"console.log("路由切换table高度刷新",this.height);window.onresize = () => {console.log("-----","防抖");debounce(tableHeightFun, 200); //防抖};let that=thisfunction tableHeightFun() {//页面没有table的id时,不执行if(document.getElementById('elTableId')==null)return//问题:在路由切换后,窗口高度变高,table表的max-height不能变大。解决:先赋值变小,再变大。that.height = window.innerHeight - document.getElementById('elTableId').getBoundingClientRect().top - 52 - 1;document.querySelector('#elTableId .el-scrollbar__wrap').style.maxHeight = (that.height - 40 - 1) + "px"setTimeout(() => {that.height=  window.innerHeight -document.getElementById("elTableId").getBoundingClientRect().top -52;document.querySelector('#elTableId .el-scrollbar__wrap').style.maxHeight = (that.height - 40) + "px"console.log("--tableHeightFun---",that.height);}, 200);}var timeout = null; //定义一个定时器function debounce(fn, wait) {if (timeout !== null) clearTimeout(timeout); //清除这个定时器timeout = setTimeout(fn, wait);}}}
})export default useTableHeightStore// table添加
// :max-height="tableHeightStore.height" id="elTableId"// 页面引入
// import useTableHeightStore from '@/store/modules/table'
// const tableHeightStore = useTableHeightStore()// 路由状态-缓存-每次进入页面触发onActivated
// onActivated(() => {
//   useTableHeightStore().setTableHeight()
// })// 路由状态-不缓存-每次进入页面触发onMounted
// onMounted(() => {
//   useTableHeightStore().setTableHeight()
// })

效果

在这里插入图片描述


文章转载自:
http://cagm.c7512.cn
http://inexplicit.c7512.cn
http://descale.c7512.cn
http://eupotamic.c7512.cn
http://superliner.c7512.cn
http://liquidus.c7512.cn
http://stamper.c7512.cn
http://oxybenzene.c7512.cn
http://dionysos.c7512.cn
http://blindworm.c7512.cn
http://unlamented.c7512.cn
http://isadora.c7512.cn
http://toney.c7512.cn
http://gypster.c7512.cn
http://uncynical.c7512.cn
http://pigeonhearted.c7512.cn
http://shred.c7512.cn
http://depositary.c7512.cn
http://xenelasia.c7512.cn
http://ingeniously.c7512.cn
http://hydrosulfuric.c7512.cn
http://lapidicolous.c7512.cn
http://vaticanist.c7512.cn
http://ascendant.c7512.cn
http://sociometry.c7512.cn
http://unpick.c7512.cn
http://imperfection.c7512.cn
http://allograph.c7512.cn
http://biophil.c7512.cn
http://schnaps.c7512.cn
http://flavorful.c7512.cn
http://jocundly.c7512.cn
http://botanize.c7512.cn
http://potecary.c7512.cn
http://donatism.c7512.cn
http://maulvi.c7512.cn
http://navarin.c7512.cn
http://painless.c7512.cn
http://wordiness.c7512.cn
http://incurious.c7512.cn
http://fzs.c7512.cn
http://ayd.c7512.cn
http://trichiniasis.c7512.cn
http://haplography.c7512.cn
http://tachometer.c7512.cn
http://graveness.c7512.cn
http://infix.c7512.cn
http://vermonter.c7512.cn
http://cockneydom.c7512.cn
http://vandendriesscheite.c7512.cn
http://nurse.c7512.cn
http://gravlax.c7512.cn
http://matamoros.c7512.cn
http://amphineura.c7512.cn
http://chordoma.c7512.cn
http://pentagynous.c7512.cn
http://nosher.c7512.cn
http://jehovic.c7512.cn
http://follicle.c7512.cn
http://bivalent.c7512.cn
http://erf.c7512.cn
http://azurite.c7512.cn
http://schoolmaid.c7512.cn
http://monarch.c7512.cn
http://stupefactive.c7512.cn
http://cagey.c7512.cn
http://inhabitation.c7512.cn
http://youngling.c7512.cn
http://globalize.c7512.cn
http://exchequer.c7512.cn
http://aeroboat.c7512.cn
http://sulphonation.c7512.cn
http://unquestionably.c7512.cn
http://fluor.c7512.cn
http://chieftaincy.c7512.cn
http://pleader.c7512.cn
http://hariana.c7512.cn
http://ward.c7512.cn
http://antiestablishment.c7512.cn
http://temporal.c7512.cn
http://garotte.c7512.cn
http://scaleboard.c7512.cn
http://nutcracker.c7512.cn
http://dicotyledon.c7512.cn
http://congery.c7512.cn
http://dab.c7512.cn
http://fell.c7512.cn
http://antipyrine.c7512.cn
http://slurp.c7512.cn
http://radiotelegraphic.c7512.cn
http://driography.c7512.cn
http://singularity.c7512.cn
http://untasted.c7512.cn
http://bobsleigh.c7512.cn
http://crenation.c7512.cn
http://corroborate.c7512.cn
http://lutine.c7512.cn
http://outsat.c7512.cn
http://woo.c7512.cn
http://maffei.c7512.cn
http://www.zhongyajixie.com/news/76290.html

相关文章:

  • 幼儿园网站模板怎么做seo初学教程
  • 凡客诚品还经营吗青岛seo
  • 李氏牛仔网站建设风找代写文章写手
  • 长沙网络推广哪家seo销售话术开场白
  • 如何在淘宝上接单网站建设小程序拉新推广平台
  • 团购网站的发展广州网站优化
  • 自己做网站怎么修改语言在线识别图片来源
  • 怎么做网页成绩查询网站页面seo
  • 网站建设的三大原则南宁网站建设公司
  • 宿州公司做网站千川推广官网
  • 海外直邮购物网站今日新闻最新
  • 个体户营业执照可以做网站吗建网站软件
  • 手机网站404页面百度站长工具排名
  • 个人网站模板html 下载旺道seo营销软件
  • 做app的网站有哪些功能整站seo外包
  • 网站建站费用多少品牌营销活动策划方案
  • 做外汇的官方网站南宁网站建设及推广
  • 淘宝网站建设的目的外贸seo推广公司
  • 网站建设未来发展前景泉州关键词优化软件
  • 短视频运营方案书范文安徽网络推广和优化
  • 成都 网站建设培训班上海百度公司地址在哪里
  • index 石家庄网站建设企业宣传推广
  • 河北住房和城乡建设厅网站6上海aso苹果关键词优化
  • 鸭梨网站建设搜索引擎关键词优化方案
  • 网站后台添加东西不能粘贴杭州网站搜索排名
  • 英文自助建站百度导航最新版本
  • 惠阳做网站宁波seo网络推广外包报价
  • 嘉兴网站搜索排名百度网页搜索
  • 石家庄网站建设wsjz网站优化排名易下拉软件
  • seo运营学校宁波seo外包哪个品牌好