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
I think the carousel is a relatively important po...
Overview This article begins to introduce content...
1. Problem Multiple floating elements cannot expa...
Table of contents 1. Docker installation on Mac 2...
Table of contents 1. What kind of backup is a dat...
Table of contents Preface step Preface Today I fo...
First of all, what is 404 and soft 404? 404: Simpl...
Today I encountered a very strange situation. Aft...
1. Command Introduction The gzip (GNU zip) comman...
The virtual machine is in use or cannot be connec...
The database, like the operating system, is a sha...
1. Check the kali linux system version Command: c...
What is HTML? HTML is a language used to describe...
This article shares the specific code of jQuery t...
Because I have a database tutorial based on SQL S...