@composy/keyboard-vue

LDesign 虚拟键盘 - Vue 3 适配器
Install
npm install @composy/keyboard-vue
Latest Version:0.0.2
Vue:3
License:MIT
Last Updated:Oct 12, 2026
Links: Gitee  ·  npm
Maintainer: swimly

@composy/keyboard-vue

@composy/keyboard-vue 是 @composy/keyboard-core 的 Vue 3 适配层,导出虚拟键盘组件、组合式函数、指令和插件,并重新导出 Core 的布局、类型、主题与工具 API。

安装

pnpm add @composy/keyboard-vue vue

组件用法

<script setup lang="ts">
import { KeyboardPopup, LicensePlateKeyboard, VirtualKeyboard } from '@composy/keyboard-vue'
import { ref } from 'vue'

const value = ref('')
const plate = ref('京A')
</script>

<template>
  <VirtualKeyboard v-model="value" type="qwerty" />
  <LicensePlateKeyboard v-model="plate" />
  <KeyboardPopup v-model="value" type="number" />
</template>

如需显式引入组件样式,可使用 @composy/keyboard-vue/index.css。

插件、指令与组合式函数

import { KeyboardVuePlugin, useKeyboard } from '@composy/keyboard-vue'
import { createApp } from 'vue'

const app = createApp(App)
app.use(KeyboardVuePlugin, { prefix: 'L' })

const keyboard = useKeyboard({ type: 'number' })
keyboard.show()

插件全局注册 LKeyboard、LKeyboardPopup、LLicensePlateKeyboard 和 v-keyboard。也可以按需使用 vKeyboard、useKeyboardPopup,或直接从适配包导入 Core API。

公开入口

  • 组件:VirtualKeyboard、KeyboardKey、KeyboardPopup、LicensePlateKeyboard
  • Composables:useKeyboard、useKeyboardPopup
  • 插件:KeyboardVuePlugin(兼容别名 KeyboardPlugin)
  • 指令:vKeyboard
  • Core:布局注册、键盘管理器、DOM 渲染器、主题、格式化函数、随机键盘工具及对应类型

构建产物

包使用 @composy/builder(rolldown)。发布目录为 dist/(UMD 与 CSS)、es/(ESM 和声明)、esm/(独立 ESM 输出)及 lib/(CJS 和声明);包的 exports、style、main、module 与 types 指向这些实际产物。

pnpm --dir libraries/keyboard run build
pnpm --dir libraries/keyboard/packages/vue run type-check
pnpm --dir libraries/keyboard/packages/vue run type-check:cjs

License

MIT

Related Packages

@koleszar.norbert/vue3-virtual-keyboard

A professional, touch-screen optimized virtual keyboard plugin for Vue 3

2,131
vue-keyboard

A virtual keyboard component for Vue applications.

30,507
@composy/cache-vue

Vue 3 适配层(基于 core 的轻量封装)/ Vue 3 adapter built on top of @composy/cac...

0
@composy/barcode-vue

条形码 Vue3 组件和组合式 API

0
v-phone-input

International phone number tools for Vuetify and Vue.

448,549 83

Version History

Version Released Vue License
0.0.2 3.5.32 MIT
0.0.1 ^3.5.32 MIT