Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

在scoped中使用deep()自定义样式的时候无效的问题 #42

Closed
nodfe opened this issue Sep 1, 2021 · 1 comment
Closed

在scoped中使用deep()自定义样式的时候无效的问题 #42

nodfe opened this issue Sep 1, 2021 · 1 comment

Comments

@nodfe
Copy link

nodfe commented Sep 1, 2021

代码如下,想要自定义Menu组件下的.n-menu .n-menu-item::before样式,但是没有效果,试过去定义.n-menu之类的也没有生效

<template>
  <NMenu
    class="custom-menu"
    :options="menus"
    :inverted="inverted"
    :mode="mode"
    :collapsed="collapsed"
    :collapsed-width="64"
    :collapsed-icon-size="14"
    :expanded-keys="openKeys"
    :value="getSelectedKeys"
    @update:value="clickMenuItem"
    @update:expanded-keys="menuExpanded"
  />
</template>
<style lang="less" scoped>
  :deep(.n-menu .n-menu-item::before) {
    left: 12px !important;
    right: 12px !important;
  }
</style>
@jekip
Copy link
Owner

jekip commented Sep 3, 2021

可以了解一下deep用法
::v-deep(.n-menu-item::before)
或者
.newMenu ::v-deep(.n-menu-item::before) 都是可行的

@jekip jekip closed this as completed Sep 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants