1.0.1 • Published 7 months ago

@lslan/screen-keyboard v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

screen-keyboard

Downloads Version

English | 简体中文

Getting started

Install

pnpm i @lslan/screen-keyboard
# or
npm install @lslan/screen-keyboard
# or
yarn add @lslan/screen-keyboard

How to use?

Global

import { createApp } from 'vue'
import App from './App.vue'
import ScreenKeyboard from '@lslan/screen-keyboard'
import '@lslan/screen-keyboard/dist/screen-keyboard.css'

const app = createApp(App).mount('#app')
app.use(ScreenKeyboard)

Local

<script setup lang="ts">
import { ref } from 'vue'
import { Keyboard, KeyboardInput } from '@lslan/screen-keyboard'
import '@lslan/screen-keyboard/dist/screen-keyboard.css'

const inputValue = ref('')

function handleInput(key: string) {
  console.log("key:", key)
}

</script>

<template>
  <div>
    <Keyboard @input="handleInput" />
    <KeyboardInput v-model:value="inputValue" />
  </div>
</template>

Components

Component nameDescriptions
KeyboardProvides a numeric and alphabetic keyboard, and its position can be dragged
KeyboardInputAn input component with the virtual keyboard

Keyboard

PropertyDescriptionTypeDefault
defaultTypeThe default keyboard typenumber | textnumber
positionThe initial position of the keyboard panel on the screen when it is displayedcenter |topCenter | bottomCenter | leftTop | leftBottom | rightTop | rightBottom | number,numberleftBottom
allowToggleAllow keyboard type switchingbooleanfalse
canMoveCan keyboard panel be moved by draggingbooleantrue
onCloseCallback when click the Close button() => void-
onInputCallback when input(key:string, isDelete:boolean, isDeleteAll:boolean) => void-
onConfirmCallback when click the Confirm button() => void-
onDeleteCallback when click the Backspace button() => void-
onDeleteAllCallback when click the Clear button() => void-

KeyboardInput

PropertyDescriptionTypeDefault
value(v-model)The input content valuestring-
showWhether to show the keyboard panelbooleanfalse
sizeThe size of the input boxsmall | middle | largemiddle
isFocusShowAuto show the keyboard panel when focusbooleanfalse
disabledWhether the input is disabledbooleanfalse
defaultTypeThe default keyboard typenumber | textnumber
positionThe initial position of the keyboard panel on the screen when it is displayedcenter | leftTop | leftBottom | rightTop | rightBottom | number,numberleftBottom
allowToggleAllow keyboard type switchingbooleanfalse
canMoveCan the keyboard panel be moved by draggingbooleantrue
onInputCallback when input(key:string, isDelete:boolean, isDeleteAll:boolean) => void-
onChangeCallback when value change(value:string) => void-
onConfirmCallback when click the Confirm button(value:string) => void-
onCloseCallback when keyboard panel display() => void-
onOpenCallback when keyboard panel show() => void-
1.0.1

7 months ago

1.0.0-beta

7 months ago

1.0.0-bate

7 months ago

1.0.0

7 months ago

0.0.2

7 months ago

0.0.1

7 months ago