修改vant组件样式无法显示的问题

2019-08-03  本文已影响0人  小透明进击战
//resetvant.less文件
.homeContainer {
    .van-swipe__track {
        height:200px;
        .van-swipe-item {
            &:nth-child(1){
            background-color: hotpink;
            }
            &:nth-child(2){
            background-color: pink;
            }
            &:nth-child(3){
            background-color: deeppink;
            }
            &:nth-child(4){
            background-color:palevioletred;
            }
        }
    }
}
//main.js文件
//解决vant样式无法覆盖的问题
import './css/resetvant.less'
//homeContainer.vue文件
<template>
    <div class="homeContainer">
        <van-swipe :autoplay="3000" indicator-color="white">
            <van-swipe-item>1</van-swipe-item>
            <van-swipe-item>2</van-swipe-item>
            <van-swipe-item>3</van-swipe-item>
            <van-swipe-item>4</van-swipe-item>
        </van-swipe>
        <h1>homeContainer</h1>
    </div>
</template>
<script>
export default {
    
}
</script>
<style lang="less" scoped>

</style>
上一篇下一篇

猜你喜欢

热点阅读