代码

  1. <template>
  2. <div>
  3.  
  4. <!-- 左侧的滑动模块 -->
  5. <div
  6. class="scroll-box"
  7. :style="{width: 410.7*screenWidth/1920+'px', height:730*screeHeight/1080+'px',top:130*screeHeight/1080+'px'}"
  8. >
  9. <div class="item" v-for="(item,index) of book" :key="index">
  10. <div
  11. class="boximg1"
  12. :style="{width: 410.7*screenWidth/1920+'px', height:208.45*screeHeight/1080+'px',marginTop:28.83*screeHeight/1080+'px'}"
  13. >
  14.  
  15. <!-- <div
  16. class="boximg3"
  17. :style="{width: 166.92*screenWidth/1920+'px', height:208.45*screeHeight/1080+'px'}"
  18. >
  19.  
  20. </div> -->
  21. <div class="text" :style="{top:25*screeHeight/1080+'px'}">{{item.dc}}</div>
  22.  
  23. </div>
  24. </div>
  25. </div>
  26.  
  27. </div>
  28. </template>
  29.  
  30. <script>
  31. export default {
  32. data() {
  33. return {
  34. screenWidth: 1000, //宽屏幕尺寸
  35. screeHeight: 1000,
  36. book: [
  37. {
  38. id: 1,
  39. zm: "A",
  40. dc: "A",
  41. dcfy: "ə",
  42. zwfy: "a字母",
  43. zwpy: "a",
  44. dctp: "图片",
  45. dcyp: "音频",
  46. fiex01: null,
  47. fiex02: null
  48. },
  49. {
  50. id: 2,
  51. zm: "A",
  52. dc: "Alligator",
  53. dcfy: "ˈælɪɡeɪtər",
  54. zwfy: "鳄鱼",
  55. zwpy: "è yú",
  56. dctp: null,
  57. dcyp: null,
  58. fiex01: null,
  59. fiex02: null
  60. },
  61. {
  62. id: 3,
  63. zm: "A",
  64. dc: "Ant",
  65. dcfy: "ænt",
  66. zwfy: "蚂蚁",
  67. zwpy: "mǎ yǐ",
  68. dctp: null,
  69. dcyp: null,
  70. fiex01: null,
  71. fiex02: null
  72. },
  73. {
  74. id: 4,
  75. zm: "A",
  76. dc: "Apple",
  77. dcfy: "ˈæpl",
  78. zwfy: "苹果",
  79. zwpy: "píng guǒ",
  80. dctp: null,
  81. dcyp: null,
  82. fiex01: null,
  83. fiex02: null
  84. }
  85. ]
  86. };
  87. },
  88.  
  89. mounted() {
  90. //获取屏幕长宽
  91. (this.screenWidth = document.documentElement.clientWidth),
  92. (this.screeHeight = document.documentElement.clientHeight),
  93. (window.onresize = () => {
  94. //屏幕尺寸变化就重新赋值
  95. return (() => {
  96. this.screenWidth = document.documentElement.clientWidth;
  97. this.screeHeight = document.documentElement.clientHeight;
  98. })();
  99. });
  100. }
  101. };
  102. </script>
  103.  
  104. <!-- Add "scoped" attribute to limit CSS to this component only -->
  105. <style scoped>
  106. .scroll-box {
  107. /* 给父盒子设置相对定位 */
  108. position: relative;
  109. /* position: relative; */
  110. box-shadow: 0 0 5px 2px #25c985;
  111. text-align: center;
  112. white-space: nowrap;
  113. overflow-y: scroll;
  114. overflow-x: hidden;
  115. /* 让父盒子水平居中
  116. margin: 0 auto; */
  117. }
  118. /* 隐藏滚动条 */
  119. ::-webkit-scrollbar {
  120. width: 0 !important;
  121. }
  122. ::-webkit-scrollbar {
  123. width: 0 !important;height: 0;
  124. }
  125. /* 横线滑动 */
  126. /* .item {
  127. white-space: nowrap;
  128. display: inline-block;
  129. } */
  130. .boximg1 {
  131. /* 给父盒子设置相对定位 */
  132. position: relative;
  133.  
  134. box-shadow: 0 0 0 1px #0f0b00;
  135. /* background: #f7aa05; */
  136. /* margin:0 20px */
  137. /* 边框圆角 */
  138. border-top-right-radius: 10px;
  139. border-top-left-radius: 10px;
  140. border-bottom-right-radius: 10px;
  141. border-bottom-left-radius: 10px;
  142. }
  143. .boximg3 {
  144. /* 给父盒子设置相对定位 */
  145. position: relative;
  146. display: flex;
  147. /* 给父盒子设置相对定位 */
  148. box-shadow: 0 0 0 2px #a09e9ee3;
  149. background: hsl(60, 9%, 98%);
  150. margin: 0 auto;
  151. /* margin:0 20px */
  152. }
  153. .text {
  154. /* 给父盒子设置相对定位 */
  155. position: relative;
  156. color: hsl(60, 9%, 98%);
  157. font-size: 20px;
  158.  
  159. -webkit-text-stroke: 0.2px rgb(15, 15, 15);
  160. }
  161. </style>

效果

vue 纵向滑动模块的更多相关文章

  1. 一个 Vue 的滑动按钮组件

    git 地址:https://github.com/SyMind/vue-sliding-button vue-better-slider 一个 Vue 的滑动按钮组件,有关滑动方面的处理借鉴 bet ...

  2. 每天记录一点:NetCore获得配置文件 appsettings.json vue-router页面传值及接收值 详解webpack + vue + node 打造单页面(入门篇) 30分钟手把手教你学webpack实战 vue.js+webpack模块管理及组件开发

    每天记录一点:NetCore获得配置文件 appsettings.json   用NetCore做项目如果用EF  ORM在网上有很多的配置连接字符串,读取以及使用方法 由于很多朋友用的其他ORM如S ...

  3. vue 图片滑动登录

    前言 最近在研究图片滑动解锁 登录,说是要用阿里的那个验证,但是还是想自己手写下这个Demo 效果图是这样的: 本来是想用canvas 来实现的,但是类,后来还想用css 和图片来代替canvas 其 ...

  4. vue使用swiper模块滑动时报错:[Intervention] Ignored attempt to cancel a touchmove event with cancelable=false, for example becaus

    报错: vue报这个错 [Intervention] Ignored attempt to cancel a touchmove event with cancelable=false, for ex ...

  5. Android 自定义ScrollView ListView 体验各种纵向滑动的需求

      分类: [android 进阶之路]2014-08-31 12:59 6190人阅读 评论(10) 收藏 举报 Android自定义ScrollView纵向拖动     转载请标明出处:http: ...

  6. Android 自己定义ScrollView ListView 体验各种纵向滑动的需求

    转载请标明出处:http://blog.csdn.net/lmj623565791/article/details/38950509.本文出自[张鸿洋的博客] 1.概述 群里的一个哥们有个需求是这种: ...

  7. 移动端弹性滑动以及vue记录滑动位置

    -webkit-overflow-scrolling介绍 -webkit-overflow-scrolling: auto | touch; auto: 普通滚动,当手指从触摸屏上移开,滚动立即停止 ...

  8. vue 左右滑动效果

    个人实际开发中用到的效果问题总结出来便于自己以后开发查看调用,如果也适用其他人请随意拿走勿喷就行! vue.js是现在流行的js框架之一,vue 是一套用于构建用户界面的渐进式javascript框架 ...

  9. VUE框架概括+模块语法使用(上)

    vue是什么 官网(https://cn.vuejs.org/) Vue.js是一套构建用户界面的渐进式框架.与其他重量级框架不同的是,Vue 采用自底向上增量开发的设计: Vue 的核心库只关注视图 ...

  10. vue滚动+滑动删除标记(移动端)仿qq/微信

    安装组件 "vue-touch": "^2.0.0-beta.4", main.js引入 import VueTouch from 'vue-touch' Vu ...

随机推荐

  1. Resport 四则运算

    使用FormatNumber 即可 [FormatNumber([Total2]/[Total1]*100)]%

  2. Visual Studio 2019注册码

    最近在学习Visual Studio,但是晕斗士(筛子系统)提示需要注册码,否则只能试用30天,由于是学习购买就没必要了,找Google找到了一下两段注册码. 目前测试了专业版已经注册成功. Visu ...

  3. 061_Apex 异常捕捉

    Trigger 中的错误处理 在 Trigger 中,我们可以为进行操作的数据进行验证,类似于验证规则.如果遇到不符合条件的数据,可以通过 addError() 函数来将错误显示给用户,并记录日志. ...

  4. Jquery_001

    jQuery 页面加载初始化的方法有3种 ,页面在加载的时候都会执行脚本,应该没什么区别,主要看习惯吧,本人觉得第二种方法最好,比较简洁. 第一种: $(document).ready(functio ...

  5. 记录一次排查OOM的过程

    服务出现了oom: 查看类信息发现char[]类型实例特别多,占用堆内存特别大 跟踪几个char[]实例的GC root,发现都是保存token信息,并且根都是session 然后查看session的 ...

  6. STM32 获取系统时钟频率

    //定义一个RCC_ClocksTypeDef 的结构体 RCC_ClocksTypeDef get_rcc_clock; //调用RCC_GetClocksFreq获取系统时钟状态 RCC_GetC ...

  7. Mac电脑设置环境变量

    转载自:https://jingyan.baidu.com/article/8065f87f47b29523312498e4.html 1.使用快捷键Command+R(或者Windows键+R),或 ...

  8. gdb 脚本 简单理解

    1. gdb 脚本的语法简介: 摘录博客:https://blog.csdn.net/hejinjing_tom_com/article/details/50350865 1]   # 为脚本注释命令 ...

  9. quartus报错 Error (10054): Verilog HDL File I/O error at sdram_ctrl_tb.v(6): can't open Verilog Design File "Sdram_params.h"

    解决方法:包含完整路径. 比如我一开始是:`include "Sdram_params.h" 错误(改为:`include "F:\FPGA\exce\uart2sdra ...

  10. 2月28日Android开发学习

    界面显示与逻辑处理 Android Studio利用XML标记描绘应用界面,使用java代码书写程序逻辑. 把App界面设计与代码逻辑分开的好处 使用XML文件描述App界面,可以很方便地在Adroi ...