This article shares the specific code of vue+swiper to achieve the timeline effect for your reference. The specific content is as follows Effect: First, if you have a Taobao image, use cnpm install swiper --save. If you don't have a Taobao image, use npm install swiper --save. <template> <div class="hello" style="height:100%;width:100%;position:relative;"> <div class="swiperlist"> <div class="swipers"> <div class="swiper-container"> <div class="swiper-wrapper"> <div class="swiper-slide" v-for="(activity, index) in superurl" :key="index"> <div style="padding-left: 4px;"> <div class="step-line"></div> <div class="step-content"> <div class="step-num"></div> <div class="sub_title">{{activity.img}}</div> </div> </div> </div> </div> </div> <div class="buttom" v-if="superurl.length>2"> <div class="swiper-button-prev"></div> <div class="swiper-button-next"></div> </div> </div> </div> </div> </template> <script> import Swiper from "swiper"; import "../../../../../node_modules/swiper/css/swiper.min.css"; import baseMap from "./baseMap.vue"; import "../../../../../static/mapbox/css/map.css"; export default { name: "Map", components: baseMap }, data() { return { superurl: [ { url: "", img: "2019-01" }, { url: "", img: "2019-02" }, { url: "", img: "2019-03" }, { url: "", img: "2019-04" }, { url: "", img: "2019-05" }, { url: "", img: "2019-06" } ] }; }, watch: {}, methods: {}, mounted() { var mySwiper = new Swiper(".swiper-container", { slidesPerView: 3, //Show three slides centeredSlides: true, //When set to true, the active slide will be centered instead of the default left. centerInsufficientSlides: true, //Turn on this parameter. When the total number of slides is less than slidesPerView, the slides are centered. Does not apply to loop mode and slidesPerColumn centeredSlidesBounds: true, //Make the first and last Slide always fit the edge. // loop: true, // loop // autoplay: true, // autoplay direction: "vertical", // vertical screen navigation: { nextEl: ".swiper-button-next", prevEl: ".swiper-button-prev" } }); } }; </script> <style scoped> .swiperlist { width: 90px; height: 256px; position: absolute; background: #f5f5f5; left: 5px; top: 205px; overflow: hidden; padding: 32px 0; border-radius: 6px; } .swipers { width: 100%; height: 250px; overflow: hidden; } .swiper-container { height: 250px !important; } .swiper-slide-active { color: #3a70ca; } .swiper-button-prev, .swiper-container-rtl .swiper-button-next { left: 28px; right: auto; top: 15px; transform: rotate(90deg); color: #3a70ca; } .swiper-button-next, .swiper-container-rtl .swiper-button-prev { top: 94%; transform: rotate(90deg); left: 28px; color: #3a70ca; } .swiper-button-next:after, .swiper-button-prev:after { font-size: 25px; } .sub_title { margin-left: 15px; margin-top: -19px; } .step-num { display: inline-block; height: 2px; width: 2px; color: #fff; background-color: #3a70ca; line-height: 30px; border-radius: 50%; text-align: center; border: 2px solid #3a70ca; margin-top: 36px; } .step-num:after { content: ""; width: 2px; height: 84px; border-left: 1.5px dotted #3a70ca; /* background-color: #3a70ca; */ position: absolute; top: 0px; margin-left: -1px; } </style> The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM. You may also be interested in:
|
<<: Detailed examples of Zabbix remote command execution
>>: Summary of some small issues about MySQL auto-increment ID
This article uses examples to describe the common...
1. Only Chinese characters can be input and pasted...
Today, it suddenly occurred to me that it would be...
This article shares with you the installation and...
1. Composition and related concepts of MySQL data...
Recently, when upgrading the Zabbix database from...
Preface With the crazy speculation of virtual cur...
Table of contents 1. Scenario 2. Basic functions ...
As a front-end monkey, whether it is during an in...
1. Download jdk download address我下載的是jdk-8u221-li...
introduction Sometimes, if there are a large numb...
1. Software Download MySQL download and installat...
1. flex-direction: (direction of element arrangem...
1. Composite primary key The so-called composite ...
DCL (Data Control Language): Data control languag...