亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

vue-awesome-swiper滑塊插件使用方法詳解

 更新時(shí)間:2022年01月27日 17:15:29   作者:大灰狼的小綿羊哥哥  
這篇文章主要為大家詳細(xì)介紹了vue-awesome-swiper滑塊插件的使用方法,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下

本文實(shí)例為大家分享了vue-awesome-swiper滑塊插件的使用方法,供大家參考,具體內(nèi)容如下

github地址

1.進(jìn)入項(xiàng)目目錄,安裝swiper

npm install vue-awesome-swiper --save

2.引入資源

//vue滑塊
import VueAwesomeSwiper from 'vue-awesome-swiper'
Vue.use(VueAwesomeSwiper)

3.編輯組件

<template>
<swiper :options="swiperOption" ref="mySwiper">
 <!-- slides -->
 <swiper-slide>I'm Slide 1</swiper-slide>
 <swiper-slide>I'm Slide 2</swiper-slide>
 <swiper-slide>I'm Slide 3</swiper-slide>
 <swiper-slide>I'm Slide 4</swiper-slide>
 <swiper-slide>I'm Slide 5</swiper-slide>
 <swiper-slide>I'm Slide 6</swiper-slide>
 <swiper-slide>I'm Slide 7</swiper-slide>
 <!-- Optional controls -->
 <div class="swiper-pagination" slot="pagination"></div>
 <div class="swiper-button-prev" slot="button-prev"></div>
 <div class="swiper-button-next" slot="button-next"></div>
 <div class="swiper-scrollbar" slot="scrollbar"></div>
</swiper>
</template>
<script>
import { swiper, swiperSlide } from 'vue-awesome-swiper'
export default {
 name: 'carrousel',
 data() {
 return {
  swiperOption: {
  // NotNextTick is a component's own property, and if notNextTick is set to true, the component will not instantiate the swiper through NextTick, which means you can get the swiper object the first time (if you need to use the get swiper object to do what Things, then this property must be true)
  // notNextTick是一個(gè)組件自有屬性,如果notNextTick設(shè)置為true,組件則不會(huì)通過NextTick來實(shí)例化swiper,也就意味著你可以在第一時(shí)間獲取到swiper對(duì)象,假如你需要?jiǎng)偧虞d遍使用獲取swiper對(duì)象來做什么事,那么這個(gè)屬性一定要是true
  notNextTick: true,
  // swiper configs 所有的配置同swiper官方api配置
  autoplay: 3000,
  // direction : 'vertical',
  effect:"coverflow",
  grabCursor : true,
  setWrapperSize :true,
  // autoHeight: true,
  // paginationType:"bullets",
  pagination : '.swiper-pagination',
  paginationClickable :true,
  prevButton:'.swiper-button-prev',
  nextButton:'.swiper-button-next',
  // scrollbar:'.swiper-scrollbar',
  mousewheelControl : true,
  observeParents:true,
  // if you need use plugins in the swiper, you can config in here like this
  // 如果自行設(shè)計(jì)了插件,那么插件的一些配置相關(guān)參數(shù),也應(yīng)該出現(xiàn)在這個(gè)對(duì)象中,如下debugger
  // debugger: true,
  // swiper callbacks
  // swiper的各種回調(diào)函數(shù)也可以出現(xiàn)在這個(gè)對(duì)象中,和swiper官方一樣
  // onTransitionStart(swiper){
  // console.log(swiper)
  // },
  // more Swiper configs and callbacks...
  // ...
  }
 }
 },components: {
 swiper,
 swiperSlide
},
 // you can find current swiper instance object like this, while the notNextTick property value must be true
 // 如果你需要得到當(dāng)前的swiper對(duì)象來做一些事情,你可以像下面這樣定義一個(gè)方法屬性來獲取當(dāng)前的swiper對(duì)象,同時(shí)notNextTick必須為true
 computed: {
 swiper() {
  return this.$refs.mySwiper.swiper
 }
 },
 mounted() {
 // you can use current swiper instance object to do something(swiper methods)
 // 然后你就可以使用當(dāng)前上下文內(nèi)的swiper對(duì)象去做你想做的事了
 // console.log('this is current swiper instance object', this.swiper)
 // this.swiper.slideTo(3, 1000, false)
 }
}
</script>

根據(jù)官方api進(jìn)行調(diào)整

以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。

相關(guān)文章

  • vue 驗(yàn)證碼界面實(shí)現(xiàn)點(diǎn)擊后標(biāo)灰并設(shè)置div按鈕不可點(diǎn)擊狀態(tài)

    vue 驗(yàn)證碼界面實(shí)現(xiàn)點(diǎn)擊后標(biāo)灰并設(shè)置div按鈕不可點(diǎn)擊狀態(tài)

    今天小編就為大家分享一篇vue 驗(yàn)證碼界面實(shí)現(xiàn)點(diǎn)擊后標(biāo)灰并設(shè)置div按鈕不可點(diǎn)擊狀態(tài),具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過來看看吧
    2019-10-10
  • 探秘Vue異步更新機(jī)制中nextTick的原理與實(shí)現(xiàn)

    探秘Vue異步更新機(jī)制中nextTick的原理與實(shí)現(xiàn)

    nextTick?是?Vue?提供的一個(gè)重要工具,它的作用主要體現(xiàn)在幫助我們更好地處理異步操作,下面就跟隨小編一起來探索一下nextTick的原理與實(shí)現(xiàn)吧
    2024-02-02
  • vue中關(guān)于el-popover的使用

    vue中關(guān)于el-popover的使用

    這篇文章主要介紹了vue中關(guān)于el-popover的使用方式,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教
    2023-04-04
  • Vue啟動(dòng)失敗報(bào)錯(cuò):Module?not?found:?Error:?Can‘t?resolve?'less-loader'解決

    Vue啟動(dòng)失敗報(bào)錯(cuò):Module?not?found:?Error:?Can‘t?resolve?&apos

    這篇文章主要給大家介紹了關(guān)于Vue啟動(dòng)失敗報(bào)錯(cuò):Module?not?found:?Error:?Can‘t?resolve?'less-loader'解決的相關(guān)資料,文中通過圖文介紹的非常詳細(xì),需要的朋友可以參考下
    2023-03-03
  • Vue中props用法介紹

    Vue中props用法介紹

    這篇文章主要給大家分享的是 Vue中props用法介紹,? 在Vue中通過props,可以將原本孤立的組件串聯(lián)起來,也就是可以子組件可以接收父組件傳遞過來的data,下面我們一起進(jìn)入文章看看內(nèi)容的詳細(xì)介紹吧,需要的朋友也可以參考一下
    2021-11-11
  • vue 項(xiàng)目引入echarts 添加點(diǎn)擊事件操作

    vue 項(xiàng)目引入echarts 添加點(diǎn)擊事件操作

    這篇文章主要介紹了vue 項(xiàng)目引入echarts 添加點(diǎn)擊事件操作,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過來看看吧
    2020-09-09
  • 使用寶塔面板中Nginx部署前端Vue項(xiàng)目完整步驟

    使用寶塔面板中Nginx部署前端Vue項(xiàng)目完整步驟

    在Kubernetes(K8S)部署前端Vue項(xiàng)目通常會(huì)涉及到使用Nginx作為靜態(tài)資源服務(wù)器的一個(gè)重要部分,這篇文章主要給大家介紹了關(guān)于使用寶塔面板中Nginx部署前端Vue項(xiàng)目的相關(guān)資料,需要的朋友可以參考下
    2024-10-10
  • vue3手動(dòng)刪除keepAlive緩存的方法

    vue3手動(dòng)刪除keepAlive緩存的方法

    當(dāng)我們未設(shè)置keepAlive的最大緩存數(shù)時(shí),當(dāng)緩存組件太多,會(huì)導(dǎo)致內(nèi)存溢出,本文給大家介紹了vue3手動(dòng)刪除keepAlive緩存的方法,文中通過代碼示例介紹的非常詳細(xì),需要的朋友可以參考下
    2024-03-03
  • 如何理解Vue的.sync修飾符的使用

    如何理解Vue的.sync修飾符的使用

    本篇文章主要介紹了如何理解Vue的.sync修飾符的使用,小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過來看看吧
    2017-08-08
  • Vue項(xiàng)目獲取url中的參數(shù)(親測(cè)可用)

    Vue項(xiàng)目獲取url中的參數(shù)(親測(cè)可用)

    這篇文章主要介紹了Vue項(xiàng)目獲取url中的參數(shù),本文通過兩種情況分析給大家詳細(xì)介紹,感興趣的朋友一起看看吧
    2022-08-08

最新評(píng)論