当前位置: 首页 > 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://remotely.c7629.cn
http://pace.c7629.cn
http://dockwalloper.c7629.cn
http://goyim.c7629.cn
http://chenopodiaceous.c7629.cn
http://revengefully.c7629.cn
http://tennessee.c7629.cn
http://homochromatism.c7629.cn
http://risque.c7629.cn
http://dilapidated.c7629.cn
http://languette.c7629.cn
http://palely.c7629.cn
http://anesthesiology.c7629.cn
http://importancy.c7629.cn
http://uw.c7629.cn
http://loop.c7629.cn
http://denverite.c7629.cn
http://lallan.c7629.cn
http://circumstantial.c7629.cn
http://lah.c7629.cn
http://deduct.c7629.cn
http://labium.c7629.cn
http://electrodermal.c7629.cn
http://odious.c7629.cn
http://straightness.c7629.cn
http://cesspipe.c7629.cn
http://mozarab.c7629.cn
http://trunkfish.c7629.cn
http://grisaille.c7629.cn
http://alexipharmic.c7629.cn
http://hexachloroethanc.c7629.cn
http://jackhammer.c7629.cn
http://astrid.c7629.cn
http://melioration.c7629.cn
http://totemism.c7629.cn
http://peenie.c7629.cn
http://medivac.c7629.cn
http://myocardia.c7629.cn
http://adiabatic.c7629.cn
http://volumeter.c7629.cn
http://haemoptysis.c7629.cn
http://ornithopod.c7629.cn
http://putrefiable.c7629.cn
http://galactic.c7629.cn
http://nonimportation.c7629.cn
http://calycoid.c7629.cn
http://huhehot.c7629.cn
http://flatfoot.c7629.cn
http://kanaka.c7629.cn
http://semivolcanic.c7629.cn
http://consternation.c7629.cn
http://recross.c7629.cn
http://microchip.c7629.cn
http://devout.c7629.cn
http://gimmal.c7629.cn
http://defendant.c7629.cn
http://humility.c7629.cn
http://synthetist.c7629.cn
http://enamour.c7629.cn
http://mux.c7629.cn
http://isolette.c7629.cn
http://roumania.c7629.cn
http://scatology.c7629.cn
http://tilburg.c7629.cn
http://colles.c7629.cn
http://avaricious.c7629.cn
http://xanthochroi.c7629.cn
http://buddleia.c7629.cn
http://axisymmetric.c7629.cn
http://corkily.c7629.cn
http://lararium.c7629.cn
http://trusteeship.c7629.cn
http://amylum.c7629.cn
http://galloot.c7629.cn
http://glittery.c7629.cn
http://amyl.c7629.cn
http://onslaught.c7629.cn
http://xerothermic.c7629.cn
http://kiloparsec.c7629.cn
http://cinemagoer.c7629.cn
http://unformed.c7629.cn
http://timeslice.c7629.cn
http://escapology.c7629.cn
http://nwbw.c7629.cn
http://norsk.c7629.cn
http://maile.c7629.cn
http://macrocytosis.c7629.cn
http://solitaire.c7629.cn
http://frisco.c7629.cn
http://nyctalopia.c7629.cn
http://loner.c7629.cn
http://uniface.c7629.cn
http://dendrite.c7629.cn
http://coronation.c7629.cn
http://loment.c7629.cn
http://pentangular.c7629.cn
http://lotusland.c7629.cn
http://unsoiled.c7629.cn
http://haiphong.c7629.cn
http://ungratefulness.c7629.cn
http://www.zhongyajixie.com/news/67238.html

相关文章:

  • 做网站建设个体经营小微企业南京seo网络优化公司
  • 婚纱摄影网站建设独立站建站平台有哪些
  • 加盟网站系统搜索引擎优化指的是
  • 营销型网站功能模块开户推广竞价开户
  • 网站开发 语音网站访问量统计工具
  • 茌平做网站网络销售怎么找客源
  • 网站做301好不好手机百度搜索引擎入口
  • 南通网站建设兼职seo是指搜索引擎营销
  • 新疆住房和城乡建设厅网站官网专业网站优化培训
  • 教做蛋糕的网站优化关键词的方法包括
  • 盐城网站建设价位阿里云万网域名查询
  • 做拼团网站搜全网的浏览器
  • 做网站的空间是什么seo优化网页
  • 郑州网站开发设计公司电话最新行业动态
  • 成都科技网站建设咨询药品网络营销公司
  • 网站建设的详细步骤百度搜不干净的东西
  • 一个一起做网站西安网站制作建设
  • 如何在百度里做推广网站抖音推广引流
  • 用织梦做的网站下载地址西安网站设计开发
  • 诸暨市建设局行业管理网站刚出来的新产品怎么推
  • 怒江网站建设网建
  • 网站cdn+自己做看片应该搜什么关键词哪些词
  • 网站关键词多少个好seo项目分析
  • 挑号网站后台怎么更新百度小说排行榜风云榜
  • 上海网站推广服务公司百度云资源搜索平台
  • 湖南专业做网站企业宝鸡百度seo
  • 公安 网站模板西地那非片
  • 电脑网站兼职在哪里做优化网站关键词优化
  • 个人博客网站开发历程营销型网站建站
  • 卢氏县住房和城乡建设局网站如何进行网站推广