Home

Awesome

input-frame GitHub package.json version GitHub

小程序输入框组件,适用于支付密码、登录密码 等。

Screenshots

<div> <img src="https://raw.githubusercontent.com/xjh22222228/weapp-input-frame/master/src/assets/demo1.jpg" width="300" /> <img src="https://raw.githubusercontent.com/xjh22222228/weapp-input-frame/master/src/assets/demo2.jpg" width="300" /> </div>

安装

安装完成在开发者工具执行 npm build

npm install weapp-input-frame -S

使用

*.json

"usingComponents": {
  "input-frame": "miniprogram_npm/weapp-input-frame/index"
}

*.wxml

<input-frame />

API

<input-frame
  value="123456"
  plaintext
  focus="{{ true }}"
  bind:change="onChange"
  bind:finished="onFinished"
/>

暴露方法

wxml

<input-frame id="input-frame />

js

// Demo
Page({
  onLoad() {
    const el = this.selectComponent('#input-frame');
    el.getValue();
  },
  setVal() {
    const el = this.selectComponent('#input-frame');
    el.setValue(282828);
  }
})

License

MIT