Stylization vuetify component v-expansion-panel__header

喜夏-厌秋 提交于 2021-02-11 12:36:20

问题


I have a Vuejs component with Vuetify and pug.

.moreQuestion__wrapper
        v-expansion-panel.moreQuestion__wrapper-panel
            v-expansion-panel-content(v-for="(question, i) in 
            questions" :key="i" expand-icon="arrow_drop_down")
                <template v-slot:header>
                  .moreQuestion__wrapper-slot {{ question }}
                </template>
                v-card
                    v-card-text.moreQuestion__wrapper-text {{ content }}

What the main problem - I've to override padding-right for v-expansion-panel__header.

What the main problem - I've to override padding-right for v-expansion-panel__header. I had tried to add different classes, but it had no effect. I know that slot isn't a real DOM component, but how to change styles for v-expansion-panel__header?


回答1:


Be careful with scoped in styles if you're using frameworks likes Bootstrap or others. If you chose , your styles haven't been overriding classes from framework. so, just remove scoped from style and it will be work.




回答2:


What did the trick for me was adding ::v-deep decaration in front of class declaration.

            /* expansion-panel */
            ::v-deep {
                .v-expansion-panel__header {
                    padding: 0;
                    flex: 0;
                    > span:first-child {
                        margin: 0 10px;
                    }
                }
                /* no expansion-panel icon */
                .v-expansion-panel__header__icon {
                    display: none;
                }
            }


来源:https://stackoverflow.com/questions/54967794/stylization-vuetify-component-v-expansion-panel-header

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!