You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

vue-keyboard-cn

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-keyboard-cn

vue virtual keyboard for wap

0.0.3
latest
npmnpm
Version published
Weekly downloads
1
-90%
Maintainers
1
Weekly downloads
 
Created
Source

vue-keyboard-cn

  • Provide custom input elements
  • Provide Chinese input keyboard
  • Provide English input keyboard
  • Provide numeric input keyboard
  • Only supports mobile web pages
  • Friendly to horizontal screen apps
  • demo
  • 中文wiki

Installation

 
 npm i vue-keyboard-cn

Usage

main.js

import { KyInput, KyBoard,KeyboardAwareScrollView } from "vue-keyboard-cn";
import "vue-keyboard-cn/dist/index.css"
Vue.component("ky-input",KyInput)
Vue.component("key-board",KyBoard)
Vue.component("key-board-aware-scroll-view", KeyboardAwareScrollView)

demo.vue



<template>
  <key-board-aware-scroll-view class="inner-wrap">
    <ky-input v-model="mixValue" placeholder="Any string"/>
    <key-board :emojiMap="emoji" />
  </key-board-aware-scroll-view>
</template>

<script>
import { person, hearts, symbo } from "../dev/emojiImages.js";
export default {
  name: "App",
  data() {
    return {
      emoji: {
        person,
        hearts,
        symbo,
      },
      mixValue: `hello,world!!`,
    };
  },
};
</script>





props

kyInput

keydescdefaultrequired
typeAny one of [int,float,cn,en,mix]mixFALSE
decimalIt will only take effect when the type is float2FALSE
regxa regular object of literal--FALSE
allowEnterCan enterFALSEFALSE
keyBoardKeyboard component $ref--FALSE
canSwitchOtherBoardCan switch other keyboardsTRUEFALSE
inputLangKeyboard display input method, cn or en can be selectedcnFALSE
showFixedInputWhether to display the input box fixed at the bottom of the keyboard -FALSEFALSE
placeholderplaceholder Text---FALSE
docBodyAutoScrollWhether to trigger the body to scroll, let the input enter the visual areaTRUEFALSE
scrollWrapSelector for scrollable dom container, replace document body scroll,like "#box",only work when you set props rotate--FALSE
rotateHorizontal screen app rotation angle,Choose between [0,90,-90].Only for horizontal screen app--FALSE

keyBoard

keydescdefaultrequired
emojiMapEmoji data reference--FALSE
disabledInputUpdateMixKeyBoardLangProhibit the input component from switching input methodsFALSEFALSE
keyBoardMapsKeyboard table of contents referenceobjectFALSE
hideHeadhide top tab headerFALSEFALSE
rotateHorizontal screen app rotation angle,Choose between [0,90,-90]FALSEFALSE

Events

keyBoard

@show

  • params
  {
    show:true,
    el:dom
  }

kyInput

  • @submit
  • @input
  • @blur
  • @focus

slots

kyInput

  • prepend
  • append
  • prependFixed
  • appendFixed

Select input content

 <button @click.stop="selectFuc">select</button>
 <button @click.stop="unselectFuc">unSelect</button>


this.$refs["inputElement"].select();
this.$refs["inputElement"].unSelect();

Q&A

  • Q:The input box is covered by the keyboard

  • A:Use KeyboardAwareScrollView component to wrap form elements

  • Q:Scrollable container is not a body node

  • A:The input component should use the props scrollWrap.Only in this way will the input component appear in the visual area when the keyboard is processed

  • Q:What to do if the app is a horizontal screen app.May be you like it vue-horizontal-screen

  • A:Add the props rotate to the KyInput element,and add the props isHscreenApp to KyBoard element

Keywords

vue

FAQs

Package last updated on 01 Aug 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts