mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2024-12-09 04:31:35 +08:00
feat(button): bordered prop
This commit is contained in:
parent
12b97ab79c
commit
7d15f230b0
@ -7,6 +7,7 @@
|
||||
- Add `n-page-header` component.
|
||||
- `n-statistic` add `label` slot.
|
||||
- `n-breadcrumb-item` add `separator` slot & prop.
|
||||
- `n-button` add `bordered` prop.
|
||||
|
||||
### Refactors
|
||||
|
||||
|
@ -7,6 +7,7 @@
|
||||
- 添加 `n-page-header` 组件
|
||||
- `n-statistic` 增加 `label` slot
|
||||
- `n-breadcrumb-item` 增加 `separator` slot & prop
|
||||
- `n-button` 增加 `bordered` prop
|
||||
|
||||
### Refactors
|
||||
|
||||
|
@ -27,6 +27,7 @@ group
|
||||
| --- | --- | --- | --- |
|
||||
| attr-type | `'button' \| 'submit' \| 'reset'` | `'button'` | The DOM `type` attribute of the button. |
|
||||
| block | `boolean` | `false` | |
|
||||
| bordered | `boolean` | `true` | |
|
||||
| circle | `boolean` | `false` | |
|
||||
| color | `string` | `undefined` | Only support `#FFF`, `#FFFFFF`, `rgb(0, 0, 0)` formatted colors. |
|
||||
| dashed | `boolean` | `false` | |
|
||||
|
@ -28,6 +28,7 @@ debug
|
||||
| --- | --- | --- | --- |
|
||||
| attr-type | `'button' \| 'submit' \| 'reset'` | `'button'` | 按钮的 DOM `type` 属性 |
|
||||
| block | `boolean` | `false` | |
|
||||
| bordered | `boolean` | `true` | |
|
||||
| circle | `boolean` | `false` | |
|
||||
| color | `string` | `undefined` | 只支持形如 `#FFF`, `#FFFFFF`, `rgb(0, 0, 0)` 的颜色 |
|
||||
| dashed | `boolean` | `false` | |
|
||||
|
@ -86,14 +86,22 @@ export default defineComponent({
|
||||
type: String as PropType<'button' | 'submit' | 'reset'>,
|
||||
default: 'button'
|
||||
},
|
||||
onClick: [Function, Array] as PropType<MaybeArray<(e: MouseEvent) => void>>
|
||||
onClick: [Function, Array] as PropType<MaybeArray<(e: MouseEvent) => void>>,
|
||||
bordered: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
}
|
||||
},
|
||||
setup (props) {
|
||||
const selfRef = ref<HTMLElement | null>(null)
|
||||
const waveRef = ref<BaseWaveRef | null>(null)
|
||||
const enterPressedRef = ref(false)
|
||||
const showBorderRef = useMemo(() => {
|
||||
return !props.text && (!props.color || props.ghost || props.dashed)
|
||||
return (
|
||||
!props.text &&
|
||||
(!props.color || props.ghost || props.dashed) &&
|
||||
props.bordered
|
||||
)
|
||||
})
|
||||
const NButtonGroup = inject<ButtonGroupInjection>('NButtonGroup', {})
|
||||
const { mergedSize: mergedSizeRef } = useFormItem(
|
||||
|
Loading…
Reference in New Issue
Block a user