virtual-keyboard
intro:
Virtual keyboard plugin
Reference
Method
setState
set state
ts
import { virtualKeyboardPlugin } from "@plaoc/plugins";
virtualKeyboardPlugin.setState({ overlay: false });
getState
get current state
ts
import { virtualKeyboardPlugin } from "@plaoc/plugins";
virtualKeyboardPlugin.getState();
setOverlay
set overlay
ts
import { virtualKeyboardPlugin } from "@plaoc/plugins";
virtualKeyboardPlugin.setOverlay(true);
getOverlay
get current overlay
ts
import { virtualKeyboardPlugin } from "@plaoc/plugins";
virtualKeyboardPlugin.getOverlay();
Parameter
$VirtualKeyboardWritableState
virtual keyboard state
ts
import type { $VirtualKeyboardWritableState } from "@plaoc/plugins";
const state: Partial<$VirtualKeyboardWritableState> = {
overlay: true,
};
Usage Plugins
vue
<script setup lang="ts">
import { ref } from "vue";
import { virtualKeyboardPlugin } from "@plaoc/plugins";
async function getState() {
const state = virtualKeyboardPlugin.getState();
}
</script>
Usage WebComponent
vue
<script setup lang="ts">
import { ref } from "vue";
import { HTMLDwebVirtualKeyboardElement } from "@plaoc/plugins";
const $virtualKeyboardPlugin = ref<HTMLDwebVirtualKeyboardElement>();
async function getState() {
const virtualKeyboard = $virtualKeyboardPlugin.value!;
const state = virtualKeyboard.getState();
}
</script>
<template>
<dweb-virtual-keyboard ref="$virtualKeyboardPlugin"></dweb-virtual-keyboard>
</template>