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

创建网站主题在哪里网站模板工具

创建网站主题在哪里,网站模板工具,阿里云如何建设网站,下载吧网站整站源码在小程序的开发中,不可避免会出现上下左右拖动表格的类似需求,下面将把这个简单实现一下 其中主要使用到了overflow: scroll;来使得横向和纵向可以滚动,并且使用负边距 父容器截断的方法来同时隐藏横向和纵向滚动条,从而实现该效…

在小程序的开发中,不可避免会出现上下左右拖动表格的类似需求,下面将把这个简单实现一下
在这里插入图片描述
其中主要使用到了overflow: scroll;来使得横向和纵向可以滚动,并且使用负边距 + 父容器截断的方法来同时隐藏横向和纵向滚动条,从而实现该效果。

负边距 + 父容器截断主要思路:

  1. 父容器:设置 overflow: hidden 截断滚动条。
  2. 子容器:
    通过通过 calc(100% + 滚动条宽度) 扩大尺寸,补偿滚动条占用的空间。
    设置 overflow: scroll 允许内容滚动。
    padding-rightpadding-bottom 补偿滚动条宽度,避免内容被遮挡。

在移动时上方的标题也会跟随滚动条一起移动,那么就需要设置 position: sticky;,配合top:0;或者left:0;等定位阈值,来设置是固定在哪里不进行移动。
position: sticky;是css中的一个定位属性,用于实现“粘性定位”的效果。作用类似于position:relative;position:fixed;的结合体:元素在滚动到特定阈值前表现为相对定位(relative),到达阈值后表现为固定定位(fixed),从而始终可见。元素会停留在父容器或视口的指定位置(如顶部),直到父容器滚动结束。
该属性依赖于两个条件:

  1. 必须指定至少一个定位阈值(如top:10px;bottom:0;等)
  2. 父容器不能有overflow:hidden;(否则失效)
<template lang=""><view class="box"><view class="placeBox"><!-- 左侧时间label --><view class="timeLabel"><view class="timeBox"><viewclass="timeStr"v-for="(t, index) in timeLabel":key="index">{{ t }}</view></view></view><!-- 右侧内容区域 --><view class="contentBox"><!-- top 场地label --><view class="placeLabel"><viewclass="placeStr"v-for="(i, index) in fieldList":key="index"@click="selectField(i)">{{ i.stationname }}</view></view><!-- content 内容区域 --><view class="content"><viewclass="colum"v-for="(p, index) in fieldList":key="index"><view v-for="cell in p.weekarr" :key="cell.hour"><view class="cell">{{ cell.hour }}</view></view></view></view></view></view></view>
</template>
<script lang="ts" setup>
import { ref } from 'vue'
const fieldList = ref([{stationname: '周一',weekarr: [{hour: '10:00',status: 0,explain: 0,},{hour: '11:00',status: 0,explain: 0,},],},{stationname: '周二',weekarr: [{hour: '10:00',status: 0,explain: 0,},{hour: '11:00',status: 0,explain: 0,},],},{stationname: '周三',weekarr: [{hour: '10:00',status: 0,explain: 0,},{hour: '11:00',status: 0,explain: 0,},],},{stationname: '周四',weekarr: [{hour: '10:00',status: 0,explain: 0,},{hour: '11:00',status: 0,explain: 0,},],},{stationname: '周五',weekarr: [{hour: '10:00',status: 0,explain: 0,},{hour: '11:00',status: 0,explain: 0,},],},{stationname: '周六',weekarr: [{hour: '10:00',status: 0,explain: 0,},{hour: '11:00',status: 0,explain: 0,},],},{stationname: '周日',weekarr: [{hour: '10:00',status: 0,explain: 0,},{hour: '11:00',status: 0,explain: 0,},],},
])const timeLabel = ref(['1号', '2号', '3号', '4号', '5号', '6号', '7号'])
</script>
<style lang="scss" scoped>
.box {width: 600rpx;height: 300rpx;overflow: hidden;.placeBox {display: flex;flex-direction: row;width: calc(100% + 20px);height: calc(100% + 20px);border: 2rpx solid #4423ff;overflow: scroll;background: #fff;padding-right: 20px; /* 避免内容被滚动条遮挡 */box-sizing: border-box; /* 确保padding不影响总尺寸 */.timeLabel {padding-top: 52rpx;position: sticky;left: 0;background: #fff;.timeBox {display: flex;flex-direction: column;border: 1rpx solid #f83b3b;padding-bottom: 20px;}.timeStr {width: 100rpx;height: 50rpx;text-align: center;line-height: 50rpx;}}.contentBox {.placeLabel {display: flex;flex-direction: row;position: sticky;top: 0;border: 1rpx solid #6dceff;.placeStr {width: 100rpx;height: 50rpx;border: 1rpx solid #000;text-align: center;line-height: 50rpx;background: #fff;}}.content {display: flex;flex-direction: row;align-items: center;justify-content: center;background: #ccc;.colum {.cell {width: 100rpx;height: 50rpx;border: 1rpx solid #000;}}}}}
}
</style>

文章转载自:

http://Txb0gQ2R.jtszm.cn
http://0OHKGfy4.jtszm.cn
http://BzidWtpF.jtszm.cn
http://9PA5jyAy.jtszm.cn
http://bwHUCpUG.jtszm.cn
http://dwk2PZVM.jtszm.cn
http://xZtIfyuT.jtszm.cn
http://iMa5sQSB.jtszm.cn
http://nxXK4zeo.jtszm.cn
http://fJQTUcSg.jtszm.cn
http://Ti4LcEas.jtszm.cn
http://shwCPQdK.jtszm.cn
http://JhCf3Aga.jtszm.cn
http://tF1vqFKC.jtszm.cn
http://aSSw4ctr.jtszm.cn
http://o2dCDj4E.jtszm.cn
http://7yHRhaQR.jtszm.cn
http://ID6Itit0.jtszm.cn
http://6xtzwSFO.jtszm.cn
http://mQBQ7QwZ.jtszm.cn
http://woY8tiXz.jtszm.cn
http://6fRuhHIq.jtszm.cn
http://64GLKUJE.jtszm.cn
http://PFWfEfPo.jtszm.cn
http://eQl7t0nm.jtszm.cn
http://wgQTasMb.jtszm.cn
http://vHudoleZ.jtszm.cn
http://wMnQlGuw.jtszm.cn
http://7zjrIcGL.jtszm.cn
http://oDqJG9ap.jtszm.cn
http://www.dtcms.com/wzjs/678830.html

相关文章:

  • 四川网站建设套餐网站建设得花多钱
  • 网站响应式和非响应式站长工具平台
  • 网站空间管理站查企业免费
  • 海口专业做网站用php做网站的开发工具
  • 网站目录结构高端网络建站
  • 虚拟体验网站网页小游戏源码
  • 自己个人的网站怎么设计移动互联网平台有哪些
  • 给小说网站做编辑教育网站建设计划书
  • 怎么自己做投票网站浙江网站建设公司排名
  • 长治市建设局网站如何仿做别人的网站
  • 阿里云建站的优缺点做网站的格言
  • 咸阳 网站建设数学网站怎么做的
  • 网站开发项目可行性网站建设好
  • 设计相关的网站有哪些内容代理网络工具
  • 佛山网站建设公司-印象互动湛江网站制作网站
  • redis做网站南通网站优建设
  • 网站建设报告wordpress企业主题 免费
  • 网站设计结果vs2012手机网站开发教程
  • 手表网站 云网站 面包屑
  • 门户网站定制龙岗做网站的
  • 网站服务做推广顺德网站设计制作
  • 潍坊cms建站系统个人名片模板
  • 网站qq号获取温州品牌网站建设
  • 湘潭网站建设 水平磐石网络网站制作课题组
  • 企业网站如何宣传wordpress 主题单页
  • 建站魔方极速网站建设自己做的博客网站
  • 阎良做网站的公司桂林做旅游网站失败的网站
  • 阿里云备案域名出售网站优化该怎么做
  • 公司内部网站创建如何在网上推广app
  • 聊城集团网站建设多少钱常州手机网站效果