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

input-plate-number

v1.5.2

Published

基于 Vue 的移动端输入车牌组件

Downloads

14

Readme

Use input-plate-number

因为是使用的 touch 事件,所以目前自定义车牌键盘只支持移动端使用

PC 端则采用 input 输入框的形式用于处理用户输入车牌

安装

yarn add input-plate-number  / npm install input-plate-number / pnpm install input-plate-number

使用

因为是基于 Vue2.x 开发的组件库,所以只支持在 Vue2.x 项目中使用

// main.js
import InputPlateNumber from 'input-plate-number'
import 'input-plate-number/lib/input-plate-number.css'

Vue.use(InputPlateNumber)
<!-- template -->
<input-plate-number></input-plate-number>

API

slot

| 参数 | 说明 | |:--------|:----------------| | default | 组件中 body 中自定义内容 |
| header | 组件头部进行自定义内容 |

props 传入参数

| 参数 | 说明 | 类型 | 默认值 | |:-------------------|:---------------|:----------|:--------| | wrapClass | 最外层的 className | String | - | | defaultPlateNumber | 初始化时展示的车牌 | String | 浙B | | keyboardVisible | 是否显示自定义键盘 | Boolean | true | | energy | 是否打开新能源开关 | Boolean | false | | isNoCar | 是否打开无牌车适配 | Boolean | false |

Events

| 事件名 | 说明 | 回调函数 | |:--------------|:------------------------------------------------|:-------------------------------------------| | done | 输入完成后触发 (移动端输入完成后则自动触发, PC 端需要按下回车键触发) | { isPlateNum: Boolean,plateNum: String } | | key-click | 输入时触发 (移动端触摸自定义车牌键盘触发, PC 端输入框输入时自动触发) | { curKey: String, plateNum: String } | | del-click | 删除时触发 (移动端触摸自定义删除键触发,PC 端按下 Backspace 回退键时触发) | { plateNum: String } | | inp-click | 移动端触摸上方输入框的时候触发 | { curIdx: Number, plateNum: String } | | change-energy | 开关新能源模块滑块时触发 | boolean | | close | 移动端关闭自定义键盘时触发 | - |

注意事项

  • ~~如果要更改默认车牌应在 created 生命周期中进行处理,否则需要利用组件 key 特性进行重新渲染才会生效~~ (1.4.1之后版本已解决)
  • 目前暂不支持 v-model 使用