0.2.2 • Published 4 years ago

vue-keyboard-zh v0.2.2

Weekly downloads
36
License
-
Repository
-
Last release
4 years ago

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--

本人菜鸟, 多多指教

0.2.2

4 years ago

0.2.1

4 years ago

0.2.0

4 years ago

0.1.5

4 years ago

0.1.4

4 years ago

0.1.3

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago