0.0.2 • Published 2 years ago

vue-keyboard-zh-ie v0.0.2

Weekly downloads
-
License
-
Repository
-
Last release
2 years ago

vue-keyboard-zh-ie

vue-keyboard-zh-ie 来自 # vue-keyboard-zh,为了兼容IE使用(请搜索vue-keyboard-zh)

<template>
    <div id="app">
        <textarea class="textarea" rows="10" v-model="value" @focus="show"></textarea>
        <Keyboard layout='numeric' :input="input" v-if="visible" :cancel='cancel'></Keyboard>
    </div>
</template>

<script>

export default {
    name: 'App',
    data() {
        return {
            value: '',
            input: null,
            visible: false
        }
    },
    methods: {
        show(e) {
            this.input = e.target
            if (!this.visible) this.visible = true
        },
        cancel() {
            this.visible = false
        }
    }
}
</script>

<style scoped>
.textarea {
    width: 100%;
    padding: 10px 20px;
    box-sizing: border-box;
}
</style>
参数说明类型可选值默认值
input触发元素HTMLInputElement/HTMLTextAreaElement--
layout键盘类型,normal: 普通字母键盘, numeric: 数字键盘stringnormal/numericnormal
cancel关闭键盘Function--

本人菜鸟, 多多指教