Skip to content

键盘 Keyboard

basic

默认效果

f
预览代码
<script setup lang="ts">
  defineOptions({ name: 'ex-keyboard-basic' })
</script>

<template>
  <g-keyboard>f</g-keyboard>
</template>

modifiers

预览代码
<script setup lang="ts">
  defineOptions({ name: 'ex-keyboard-modifiers' })
</script>

<template>
  <g-keyboard command />
  <g-keyboard shift />
  <g-keyboard alt />
  <g-keyboard ctrl />
</template>

combination

feb
预览代码
<script setup lang="ts">
  defineOptions({ name: 'ex-keyboard-combination' })
</script>

<template>
  <g-keyboard command>f</g-keyboard>
  <g-keyboard shift>e</g-keyboard>
  <g-keyboard shift alt>b</g-keyboard>
</template>

small

as@

as@
预览代码
<script setup lang="ts">
  defineOptions({ name: 'ex-keyboard-small' })
</script>

<template>
  <g-keyboard>a</g-keyboard>
  <g-keyboard>s</g-keyboard>
  <g-keyboard>@</g-keyboard>
  <br />
  <br />
  <g-keyboard small>a</g-keyboard>
  <g-keyboard small>s</g-keyboard>
  <g-keyboard small>@</g-keyboard>
</template>

Attributes

属性描述类型推荐值默认
commandKey Commandboolean-false
shiftKey Shiftboolean-false
altKey Alt Optionboolean-false
optionKey Optionboolean-false
ctrlKey Controlboolean-false
smallsmall componentboolean-false

Released under the MIT License.