naive-ui
naive-ui copied to clipboard
n-drawer 上使用n-button 自定义背景颜色显示不正常
TuSimple/naive-ui version (版本)
2.32.2-beta.0
Vue version (Vue 版本)
3.2.37
Browser and its version (浏览器及其版本)
Chrome Version 104.0.5112.79 (Official Build) (arm64)
System and its version (系统及其版本)
MacOS(12.2.1)
Node version (Node 版本)
Reappearance link (重现链接)
https://codesandbox.io/s/compassionate-dew-31xnl5?file=/src/Demo.vue
Reappearance steps (重现步骤)
添加一个n-button,通过css让其background-color为绿色,hover变黄色。 同一个button在主界面显示正常,在n-drawer里hover正常,非hover时没有显示background-color
Expected results (期望的结果)
n-button的背景颜色在n-drawer里正常显示
Actual results (实际的结果)
n-button的背景颜色在n-drawer里不显示
Remarks (补充说明)
是正常显示的
hover的时候显示正常,但是没有hover的时候背景色并不是绿色,见截图
当点击drawer上任意一点后,显示正常,如下
这是 auto-focus 导致的,所以一进去就用了 button 的 focus 状态了。
这是 auto-focus 导致的,所以一进去就用了 button 的 focus 状态了。
感谢!