vue使用swipe組件

1.安裝

npm install vue-swipe

2.main.js中

import { Swipe, SwipeItem } from 'vue-swipe';

//注冊(cè)輪播圖
Vue.component('swipe', Swipe);
Vue.component('swipe-item', SwipeItem);

3.banner.vue

<template>
    <swipe class="my-swipe">
        <swipe-item class="slide1"></swipe-item>
        <swipe-item class="slide2"></swipe-item>
        <swipe-item class="slide3"></swipe-item>
    </swipe>
</template>
<script>
export default {
   
}
</script>
<style lang="scss">
@import 'vue-swipe/dist/vue-swipe.css';
.my-swipe {
  height: 200px;
  color: #fff;
  font-size: 30px;
  text-align: center;
}

.slide1 {
  background-color: #0089dc;
  color: #fff;
}

.slide2 {
  background-color: #ffd705;
  color: #000;
}

.slide3 {
  background-color: #ff2d4b;
  color: #fff;
}
</style>

4. index.vue

<banner></banner>
<script>
import banner from './banner.vue'

export default {
    components: {
        banner: banner
    },
    data () {
        return {

        }
    }
}
</script>
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

  • 大半夜的睡不著,眼睛很累,腦袋一直不停轉(zhuǎn)動(dòng),就寫一寫最近的狀態(tài)吧,安慰一下這不肯停歇的腦袋。 剛和畢業(yè)時(shí)就...
    管糖糖閱讀 411評(píng)論 0 1
  • 一階打卡第十九天 暑假要來了,我覺得我真正的挑戰(zhàn)要來臨了,小東西像是有預(yù)感似的,這最后一天開始咳嗽流鼻涕了,家里有...
    小米媽咪閱讀 302評(píng)論 0 0
  • 不知道從什么時(shí)候開始,我開始變得不想長(zhǎng)大了。我多希望,我就一直一直是十幾歲,爸爸媽媽一直一直是現(xiàn)在的模樣,爺爺奶奶...
    藍(lán)綠小巨人閱讀 700評(píng)論 40 23
  • 身邊總會(huì)遇到一些人,他們整日抱怨不斷,怨天尤人,好像命運(yùn)專和他們做對(duì)。他們認(rèn)為自己的遭遇是人間最不幸的。 我的生活...
    夏莉01閱讀 377評(píng)論 2 6

友情鏈接更多精彩內(nèi)容