1 Star 1 Fork 2

杨洋/微信小程序 数字键盘

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

keyboard-num

小程序自定义组件

fork from https://github.com/holidaypenguin/miniprogram-keyboard-num

使用此组件需要依赖小程序基础库 2.2.3 以上版本,同时依赖开发者工具的 npm 构建。具体详情可查阅官方 npm 文档

使用效果

keyboard-num

使用方法

  1. 安装 keyboard-num:
npm install --save miniprogram-keyboard-color-num
  1. 在需要使用 keyboard-num 的页面 page.json 中添加 keyboard-num 自定义组件配置
{
  "usingComponents": {
    "keyboard-num": "miniprogram-keyboard-color-num",
    "keyboard-num-light": "miniprogram-keyboard-color-num/light"
  }
}
  1. 点击 工具 -> 构建npm

  2. WXML 文件中引用 keyboard-num

<keyboard-num></keyboard-num>
<keyboard-num-light></keyboard-num-light>

引用后自动从铺设在给定高度的地方,建议是100%的高度。

keyboard-num的属性介绍如下:

属性名 类型 默认值 是否必须 说明
value String - - 当前输入值:组件外部可以通过此可以改变组件内部的值
type String default - 当前输入类型:指定当前组件的输入类型默认只能是数字字符串,为money时为金额形式
max Number -1 - 最大值
maxLength Number -1 - 最大长度
useFormate Boolean true - 是否使用格式化显示
title String 请输入 - 输入框标题
tips String - - 输入框提示文字
submit String 确定 - 确认按钮提示文字
color String #F6504D - 确认按钮颜色

keyboard-num的事件介绍如下:

change事件

{
  detail: {
    value: {
      current: '', // 当前未格式化输入值
      currentNum: '', // 金额转化为分,默认模式的时候为0
    }
  }
}

confirm事件

{
  detail: {
    value: {
      current: '', // 当前未格式化输入值
      currentNum: '', // 金额转化为分,默认模式的时候为0
    }
  }
}
MIT License Copyright (c) 2018 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

fork from https://github.com/holidaypenguin/miniprogram-keyboard-num 展开 收起
JavaScript
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/pleaseyang/miniprogram-keyboard-num.git
git@gitee.com:pleaseyang/miniprogram-keyboard-num.git
pleaseyang
miniprogram-keyboard-num
微信小程序 数字键盘
master

搜索帮助

344bd9b3 5694891 D2dac590 5694891