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

标记(badge)不能遮盖住「按钮聚焦时高亮的边框」 #5929

Open
5 tasks done
yd278 opened this issue May 7, 2024 · 1 comment · May be fixed by #5930
Open
5 tasks done

标记(badge)不能遮盖住「按钮聚焦时高亮的边框」 #5929

yd278 opened this issue May 7, 2024 · 1 comment · May be fixed by #5930
Assignees
Labels
untriaged need to sort

Comments

@yd278
Copy link

yd278 commented May 7, 2024

描述错误

bug-report
如图,鼠标悬浮在按钮上时,标记无法盖住边框线

复现步骤

呃就 鼠标移上去?

最小复现链接

https://gist.github.com/yd278/018ba71096bd2faf4bb39b1866e16cb7

系统信息

System:
    OS: macOS 14.4.1
    CPU: (8) arm64 Apple M1 Pro
    Memory: 130.63 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.12.1 - /usr/local/bin/node
    npm: 10.5.0 - /usr/local/bin/npm
  Browsers:
    Safari: 17.4.1
  npmPackages:
    naive-ui: ^2.38.2 => 2.38.2 
    vue: ^3.4.21 => 3.4.23 

(但是实际上在用Electron?)

使用的包管理器

npm

验证

@yd278 yd278 added the untriaged need to sort label May 7, 2024
@jahnli jahnli self-assigned this May 8, 2024
@jahnli jahnli linked a pull request May 8, 2024 that will close this issue
@TianQian-A
Copy link

将结构改成这样就行了。

<script setup lang="ts">
import { NButton } from 'naive-ui'
import { defineModel } from 'vue'
import { NBadge } from 'naive-ui'
const buttonType = defineModel<'default' | 'primary'>('state', { default: 'default' })
function toggleButtonType() {
  buttonType.value = buttonType.value === 'default' ? 'primary' : 'default'
}
const remaining = defineModel<number>('remaining', { default: 9 })
</script>

<template>
    <n-badge :value="remaining" type="info">
      <n-button :focusable="false" :type="buttonType" @click="toggleButtonType"></n-button>
      <template #value>
        <slot></slot>
      </template>
    </n-badge>
</template>

<style scoped>
.n-button {
  width: 60px;
  height: 60px;
  padding: 0;
}
</style>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
untriaged need to sort
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants