Skip to content

virtual-keyboard

NPM version

Platform Support

Platform Support

介绍:

虚拟键盘插件

Reference

Method

  • setState

    设置状态

ts
import { 
virtualKeyboardPlugin
} from "@plaoc/plugins";
virtualKeyboardPlugin
.
setState
({
overlay
: false });
  • getState

    获取当前状态

ts
import { 
virtualKeyboardPlugin
} from "@plaoc/plugins";
virtualKeyboardPlugin
.
getState
();
  • setOverlay

    设置覆盖

ts
import { 
virtualKeyboardPlugin
} from "@plaoc/plugins";
virtualKeyboardPlugin
.
setOverlay
(true);
  • getOverlay

    获取覆盖状态

ts
import { 
virtualKeyboardPlugin
} from "@plaoc/plugins";
virtualKeyboardPlugin
.
getOverlay
();

Parameter

  • $VirtualKeyboardWritableState

    虚拟键盘状态值

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>

基于 MIT 许可发布