mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-14 20:19:34 +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'
|
||||
*/
|
||||
as?: any
|
||||
value: KbdKey | string
|
||||
value?: KbdKey | string
|
||||
variant?: KbdVariants['variant']
|
||||
size?: KbdVariants['size']
|
||||
class?: any
|
||||
|
||||
@@ -35,7 +35,10 @@ const _useKbd = () => {
|
||||
metaSymbol.value = macOS.value ? kbdKeysMap.command : kbdKeysMap.ctrl
|
||||
})
|
||||
|
||||
function getKbdKey(value: KbdKey | string) {
|
||||
function getKbdKey(value?: KbdKey | string) {
|
||||
if (!value) {
|
||||
return
|
||||
}
|
||||
if (value === 'meta') {
|
||||
return metaSymbol.value
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user