npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

vue-akeyboard

v1.0.0

Published

本项目是一个vue虚拟键盘项目,基于<a href="https://github.com/18510047382/A-Keyboard">akeyboard</a>改造,修改了部分样式,并支持自定义键盘。

Downloads

5

Readme

简介

本项目是一个vue虚拟键盘项目,基于akeyboard改造,修改了部分样式,并支持自定义键盘。

安装

组件

$ npm i vue-akeyboard
或
$ yarn add vue-akeyboard

源码

github

$ yarn
$ yarn serve

使用

main.js

import VueAkeyboard from 'vue-akeyboard'
Vue.use(VueAkeyboard)

vue

<template>
  <div>
    <input id="text"
           v-model="text">
    <input id="text2"
           v-model="text2">
    <vue-akeyboard ref="kb"
                   :ele="ele"
                   :keys="keys"
                   @click="handleKeyboardClick"
                   style="width: 800px; height: 300px"></vue-akeyboard>
  </div>
</template>

<script>
export default {
  data () {
    return {
      keys: [
        ['1', '2', '3', '4', '5', '6', '7', '8', '9', '0'],
        ['a', 'b', 'c', 'd', 'Shift', '清空']
      ],
      text: '',
      text2: '',
      ele: 'text'
    }
  },
  mounted () {
    // 自定义按键绑定click
    this.$refs.kb.bindClick("清空", () => {
      this[this.ele] = ''
    })
    // 模拟更换输入框
    setTimeout(() => {
      this.ele = "text2"
    }, 5000);
  },
  methods: {
    // 键盘点击
    handleKeyboardClick (key, val) {
      this[this.ele] = val
    }
  }
}
</script>

属性

| 参数 | 说明 | 类型 | 默认值 | 可选值 | | ------ | ------ | ------ | ------ | ----- | | ele | 输入框的id | String | 无 | - | | keys | 自定义按键 | Array | 无 | - | | theme | 主题 | String | 'default' | default/dark/green/classic | | type | 类型 | String | 'default' | default/number/mobile | | fixed-bottom-center | 固定在底部中间 | Boolean | false | true/false | | rebind | 更换输入框时是否重新绑定之前的自定义按钮点击事件 | Boolean | true | true/false

keys内置按键

default:| Shift | Caps | Delete | Enter | Space | Tab | mobile:| ⇧ | ⇦ | Enter | Space | number:| Delete | Enter |

事件

| 名称 | 说明 | 回调参数 | | ------ | ------ | ------ | | click | 键盘点击回调 | (key, val) 点击的按键,键盘总值 |

方法

| 名称 | 说明 | 参数 | | ------ | ------ | ------ | | bindClick | 绑定自定义按键的点击事件 | (btn, fn) 按钮名称,回调函数 |

打包

组件

$ yarn lib

源码

$ yarn build

捐赠

如果你觉得本项目帮助到你的话,可以给作者买杯咖啡。

License

MIT