mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-27 18:30:35 +01:00
fix(Kbd): optional value prop when using default slot
This commit is contained in:
@@ -17,7 +17,7 @@ export interface KbdProps {
|
|||||||
* @defaultValue 'kbd'
|
* @defaultValue 'kbd'
|
||||||
*/
|
*/
|
||||||
as?: any
|
as?: any
|
||||||
value: KbdKey | string
|
value?: KbdKey | string
|
||||||
variant?: KbdVariants['variant']
|
variant?: KbdVariants['variant']
|
||||||
size?: KbdVariants['size']
|
size?: KbdVariants['size']
|
||||||
class?: any
|
class?: any
|
||||||
|
|||||||
@@ -35,7 +35,10 @@ const _useKbd = () => {
|
|||||||
metaSymbol.value = macOS.value ? kbdKeysMap.command : kbdKeysMap.ctrl
|
metaSymbol.value = macOS.value ? kbdKeysMap.command : kbdKeysMap.ctrl
|
||||||
})
|
})
|
||||||
|
|
||||||
function getKbdKey(value: KbdKey | string) {
|
function getKbdKey(value?: KbdKey | string) {
|
||||||
|
if (!value) {
|
||||||
|
return
|
||||||
|
}
|
||||||
if (value === 'meta') {
|
if (value === 'meta') {
|
||||||
return metaSymbol.value
|
return metaSymbol.value
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user