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

希望主题支持select组件添加border样式 #5369

Closed
ltxhhz opened this issue Nov 8, 2023 · 2 comments
Closed

希望主题支持select组件添加border样式 #5369

ltxhhz opened this issue Nov 8, 2023 · 2 comments
Labels
feature request New feature or request

Comments

@ltxhhz
Copy link

ltxhhz commented Nov 8, 2023

This function solves the problem (这个功能解决的问题)

themeOverrides和主题编辑器可以添加或修改select的border样式
因为同样为输入组件的input是支持border的
image
并且select组件中也有用来配置border的元素
image

Expected API (期望的 API)

可以在themeOverrides和主题编辑器中添加或修改select的border样式

@github-actions github-actions bot added the feature request New feature or request label Nov 8, 2023
@jizai1125
Copy link
Contributor

jizai1125 commented Nov 21, 2023

可以改的,Select 组件复用了内部组件 InternalSelection,所以改的话需要通过 peers,参考文档 使用 peers 主题变量

<script lang="ts">
  import { NConfigProvider, GlobalThemeOverrides } from 'naive-ui'

  const themeOverrides: GlobalThemeOverrides = {
    Select: {
      peers: {
        InternalSelection: {
          border: '1px solid red'
        }
      }
    }
  }
</script>

<template>
  <n-config-provider :theme-overrides="themeOverrides">
    <my-app />
  </n-config-provider>
</template>

@ltxhhz
Copy link
Author

ltxhhz commented Nov 21, 2023

明白了,感谢🙏

@ltxhhz ltxhhz closed this as completed Nov 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants