vue.js有轮播图插件吗
生活随笔
收集整理的這篇文章主要介紹了
vue.js有轮播图插件吗
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
vue.js有輪播圖插件,例如vue-concise-slider,它是基于Swiper4、適用于Vue的輪播組件,支持服務端渲染和單頁應用;vue-awesome-swiper配置簡單,支持自適應/全屏+按鈕+分頁,同時兼容移動和PC端。
vue.js輪播圖插件vue-awesome-swiper
vue-awesome-swiper是基于 Swiper4、適用于 Vue 的輪播組件,支持服務端渲染和單頁應用。
vue-awesome-swiper是基于swiper的,安裝不同版本的vue-awesome-swiper對應不同的swiper,所以swiper里面的屬性多數能應用到vue-awesome-swiper中,也可以根據swiper文檔來設置vue-awesome-swiper屬性;
swiper官方文檔:https://www.swiper.com.cn/api/index2.html
安裝:
npm install vue-awesome-swiper --save
導入使用:
// import
import Vue from 'vue'
import VueAwesomeSwiper from 'vue-awesome-swiper'
// mount with global
Vue.use(VueAwesomeSwiper)
// mount with component
import { swiper, swiperSlide } from 'vue-awesome-swiper'
export default {
components: {
swiper,
swiperSlide
}
}
案例展示及示例代碼:
https://surmon-china.github.io/vue-awesome-swiper/
注意版本變化
starting with version 2.6.0, you need to manually introduce swiper's css
import 'swiper/dist/css/swiper.css'
更多編程相關知識,請訪問:編程課程!!
總結
以上是生活随笔為你收集整理的vue.js有轮播图插件吗的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 疲软惠普转型痛,逆增联想心头乐
- 下一篇: OCS Inventory NG使用之在