带直接子项的Vue-Loader深度选择器

时间:2019-05-16 23:57:18

标签: css vue.js vue-loader

我有一个标签组件,里面有其他标签

<tabs :class="{ 'my-class': ifTrue }">
    <tab v-for="tab in tabs">
        ...
    </tab>
    <tab-item v-for="tab in tabs">
        <tabs :class="{ 'my-class': ifTrue }">
            <tab v-for="tab in tabs">
                ...
            </tab>
            <tab-item v-for="tab in tabs">
                ...
            </tab-item>
        </tab>
    </tab-item>
</tab>

<style scoped>
    .no-tabs >>> .tab {
        display: none
    }
</style>

从我使用tabs的组件中,我想隐藏直接子项tab(如果有该类),问题是当我像上面那样应用该类时,它将隐藏{同样,在tab中的{1}},我只想隐藏直接制表符子项。

tab-item

但是这些都不起作用,如何仅访问第一个选项卡的直接子项In css would be .no-tabs > .tab But in vue i try this but wont work. .no-tabs >>> > .tab or .no-tabs > >>> .tab

我无法编辑.tab组件,这就是为什么我不直接在那做。

1 个答案:

答案 0 :(得分:1)

由于某种原因,vue-loader无法理解此表单

.no-tabs >>> > .tab

使用对我有用的

.no-tabs /deep/ > .tab

相关问题