在这里为什么class="filter-container"没有效果

img


vue单页面里,我在绑定class的时候,发现①样式错乱,②才能达到想要的结果。

img


页面里不能写class="filter-container"这种格式吗?我用class="filterContainer"这种格式,样式添加不上去。

你使用F12检查一下,你要设置的dom 的class肯定不再是filter或者filter-container,你使用elementui一般不能直接通过class名改,有的组件会把class名通过 组件名-class等这种对外开放(如:popper-class),最简单就是通过检查去找某个dom的class进行样式修改

因为你.filter-container里面套用了element组件组件里的优先级更高吧