Skip to content

Commit 011a02e

Browse files
author
Tenny
committed
fix(Button): 修复暗黑模式下样式显示异常
Signed-off-by: Tenny <joel.shu@qq.com>
1 parent 8a9ad64 commit 011a02e

File tree

5 files changed

+42
-4
lines changed

5 files changed

+42
-4
lines changed

docs/components/popover.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,29 @@
252252
</CodePreview>
253253
</ClientOnly>
254254

255+
### 不显示箭头
256+
257+
通过传递 `show-arrow``false` 来取消箭头显示
258+
259+
<ClientOnly>
260+
<CodePreview>
261+
<textarea lang="vue-html">
262+
<nt-popover content="悬浮提示" :show-arrow="false">
263+
<template #trigger>
264+
<span>悬浮</span>
265+
</template>
266+
</nt-popover>
267+
</textarea>
268+
<template #preview>
269+
<Popover content="悬浮提示" :show-arrow="false">
270+
<template #trigger>
271+
<span>悬浮</span>
272+
</template>
273+
</Popover>
274+
</template>
275+
</CodePreview>
276+
</ClientOnly>
277+
255278
## API
256279

257280
### Popover Props

src/components/Button.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ const colorStyle = computed(() => {
7676
const darken = adjust(props.color, 3, false);
7777
const cssVars = {
7878
'--nt-btn-border-color': props.text ? 'transparent' : props.color,
79-
'--bt-btn-text-color':
79+
'--nt-btn-text-color':
8080
props.ghost || props.text ? props.color : '#ffffff',
8181
'--nt-btn-hover-text-color':
8282
props.ghost || props.text ? lighten : '#ffffff',

src/components/popover/Popover.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,9 @@ export default defineComponent({
240240
: props.content != null
241241
? h('span', props.content)
242242
: null,
243-
h('span', { class: 'nt-popover-arrow' }),
243+
props.showArrow
244+
? h('span', { class: 'nt-popover-arrow' })
245+
: null,
244246
],
245247
),
246248
[[vShow, show.value]],

src/components/popover/constant.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,9 @@ export const popoverProps = {
3333
},
3434
/** 受控模式时对应的节点 */
3535
to: [Object, String] as PropType<HTMLElement | string | Ref<HTMLElement>>,
36+
/** 是否显示箭头 */
37+
showArrow: {
38+
type: Boolean,
39+
default: true,
40+
},
3641
};

style/button/index.css

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,9 @@
7676

7777
.nt-btn-normal {
7878
/* 按钮的文字颜色 */
79-
--nt-btn-text-color: rgba(0, 0, 0, 0.65);
79+
--nt-btn-text-color: auto;
8080
/* 按钮的背景色 */
81-
--nt-btn-background: #fff;
81+
--nt-btn-background: transparent;
8282
/* 按钮的边框颜色 */
8383
--nt-btn-border-color: #d9d9d9;
8484
/* 按钮的悬浮边框 less lighten(var(--nt-primary-color), 10) */
@@ -164,3 +164,11 @@
164164
.nt-btn:not(.nt-btn-text) + .nt-btn {
165165
margin-left: 10px;
166166
}
167+
168+
html.dark {
169+
.nt-btn:disabled {
170+
--nt-btn-disabled-background: rgba(255, 255, 255, 0.08);
171+
--nt-btn-disabled-color: rgba(255, 255, 255, 0.3);
172+
--nt-btn-disabled-border-color: rgba(255, 255, 255, 0.3);
173+
}
174+
}

0 commit comments

Comments
 (0)