Giter Club home page Giter Club logo

num-input's Introduction

num-input

微信小程序自定义组件带加减的数字输入框。

预览

preview

使用

  1. 安装
$ yarn add num-input
  1. 点击开发者工具中的菜单栏:工具 --> 构建 npm
  2. 在需要使用的页面配置文件中添加引用
{
  "usingComponents": {
    "num-input": "num-input"
  }
}

更多关于小程序中使用 npm 包的信息参见官方文档 npm 支持

示例:

page.json

{
  "usingComponents": {
    "num-input": "num-input"
  }
}

page.wxml

<num-input bindinput="onInput" value="{{ num }}" size="m" />

page.js

Page({
  data:{
    num: 1,
  }
  onInput(event) {
    this.setData({
      num: event.detail.value
    })
  },
});

配置项

属性 默认值 描述
value - 输入框的值
disabled - 是否禁用
step 1 加减点击后的步长
ext-class-input - 自定义输入框类名
ext-class-increase - 自定义加号按钮框类名
ext-class-decrease - 自定义减号按钮类名
size m 尺寸,可选值 s|m|l

事件

事件名 描述
input 输入框的发生变化

相关资源

num-input's People

Contributors

wayou avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

natuka

num-input's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.