vue+swiper實(shí)現(xiàn)時(shí)間軸效果
本文實(shí)例為大家分享了vue+swiper實(shí)現(xiàn)時(shí)間軸效果的具體代碼,供大家參考,具體內(nèi)容如下
效果:
首先引入,有淘寶鏡像的用 cnpm install swiper --save 沒(méi)有的用 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, //顯示三個(gè)輪播 centeredSlides: true, //設(shè)定為true時(shí),active slide會(huì)居中,而不是默認(rèn)狀態(tài)下的居左。 centerInsufficientSlides: true, //開(kāi)啟這個(gè)參數(shù),當(dāng)slides的總數(shù)小于slidesPerView時(shí),slides居中。不適用于loop模式和slidesPerColumn centeredSlidesBounds: true, //使得第一個(gè)和最后一個(gè)Slide 始終貼合邊緣。 // loop: true, //循環(huán) // autoplay: true, //自動(dòng)播放 direction: "vertical", //豎屏 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>
以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。
- Vue實(shí)現(xiàn)時(shí)間軸效果
- vue實(shí)現(xiàn)橫向時(shí)間軸
- Vue實(shí)現(xiàn)時(shí)間軸功能
- vue實(shí)現(xiàn)兩列水平時(shí)間軸的示例代碼
- VUE實(shí)現(xiàn)時(shí)間軸播放組件
- vue+canvas繪制時(shí)間軸的方法
- Vue.js實(shí)現(xiàn)時(shí)間軸功能
- vue實(shí)現(xiàn)物流時(shí)間軸效果
- Vue時(shí)間軸 vue-light-timeline的用法說(shuō)明
- Vue實(shí)現(xiàn)可移動(dòng)水平時(shí)間軸
- element step組件在另一側(cè)加時(shí)間軸顯示
相關(guān)文章
vue router 通過(guò)路由來(lái)實(shí)現(xiàn)切換頭部標(biāo)題功能
在做單頁(yè)面應(yīng)用程序時(shí),一般頁(yè)面布局頭尾兩塊都是固定在布局頁(yè)面,中間為是路由入口。這篇文章主要介紹了vue-router 通過(guò)路由來(lái)實(shí)現(xiàn)切換頭部標(biāo)題 ,需要的朋友可以參考下2019-04-04如何處理vue router 路由傳參刷新頁(yè)面參數(shù)丟失
這篇文章主要介紹了如何處理vue router 路由傳參刷新頁(yè)面參數(shù)丟失,對(duì)vue感興趣的同學(xué),可以參考下2021-05-05Vue中使用iframe踩坑問(wèn)題記錄 iframe+postMessage
這篇文章主要介紹了Vue中使用iframe踩坑問(wèn)題記錄 iframe+postMessage,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教2022-09-09基于Vue的SPA動(dòng)態(tài)修改頁(yè)面title的方法(推薦)
這篇文章主要介紹了基于Vue的SPA動(dòng)態(tài)修改頁(yè)面title的方法,需要的朋友可以參考下2018-01-01詳解基于vue-cli3快速發(fā)布一個(gè)fullpage組件
這篇文章主要介紹了詳解基于vue-cli3快速發(fā)布一個(gè)fullpage組件,小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過(guò)來(lái)看看吧2019-03-03mpvue中配置vuex并持久化到本地Storage圖文教程解析
這篇文章主要介紹了mpvue中配置vuex并持久化到本地Storage的教程詳解,# 配置vuex和在vue中相同,只是mpvue有一個(gè)坑,就是不能直接在new Vue的時(shí)候傳入store。本文分步驟給大家介紹的非常詳細(xì),需要的朋友參考下吧2018-03-03vue-cli+webpack項(xiàng)目 修改項(xiàng)目名稱的方法
下面小編就為大家分享一篇vue-cli+webpack項(xiàng)目 修改項(xiàng)目名稱的方法,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過(guò)來(lái)看看吧2018-02-02