vscode vant 样式覆盖、自定义样式 dropdown-menu-content-max-height

 

@dropdown-menu-content-max-height 默认是80%,想改成100%

官方文档太复杂,不太懂:https://vant-contrib.gitee.io/vant/#/zh-CN/dropdown-menu

仅改css怎么弄?

加scoped则失效

<style scoped>

 .my-dropdown-menu .van-dropdown-item__content {
    position: absolute;
    max-height: 100% !important;
 }
 

</style>

去掉scoped,会影响全局页面。需要加上class类名称,控制作用域。

<style>

 .my-dropdown-menu .van-dropdown-item__content {
    position: absolute;
    max-height: 100% !important;
 }
 

</style>

  应用:

    <van-dropdown-menu active-color="rgb(4,190,2)" duration="0" class="my-dropdown-menu" >
        <van-dropdown-item v-model="stationType" :options="stationTypeList2" />
        <van-dropdown-item v-model="displayType" :options="displayTypeList2" />
        <van-dropdown-item title="筛选" ref="item"  >   
            <div>
               
                    <div style="padding: 5px 16px 10px 16px">
                        <van-button type="primary" block round @click="searchClick">
                            确认
                        </van-button>
                    </div>
              
            </div>
        </van-dropdown-item>      
    </van-dropdown-menu>

  

 

posted @ 2021-12-08 09:42  hao_1234_1234  阅读(1183)  评论(0编辑  收藏  举报