├── screenshot
└── 1.gif
├── .gitignore
├── package.json
├── README.md
├── wepy.config.js
└── pwdfield.wpy
/screenshot/1.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/colmugx/wepy-com-pwdfield/HEAD/screenshot/1.gif
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # https://git-scm.com/docs/gitignore
2 | # https://help.github.com/articles/ignoring-files
3 | # Example .gitignore files: https://github.com/github/gitignore
4 | /bower_components/
5 | /node_modules/
6 | .DS_Store
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "wepy-com-pwdfield",
3 | "version": "0.1.0",
4 | "description": "wepy component, for use in password field.",
5 | "main": "pwdfield.wpy",
6 | "author": "ColMugX",
7 | "license": "MIT",
8 | "repository": {
9 | "type": "git",
10 | "url": "git+https://github.com/ColMugX/wepy-com-pwdfield"
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # wepy-com-pwdfield
2 |
3 | [](https://nodei.co/npm/wepy-com-pwdfield/)
4 |
5 | > 适用于房间号输入,验证码输入,密码等有位数限制明密文输入框
6 |
7 |
8 | 
9 |
10 | ## 安装 Install
11 |
12 | > npm install -S wepy-com-pwdfield
13 |
14 | ## 使用 Usage
15 |
16 | ```js
17 | import Pwdfield from 'wepy-com-pwdfield'
18 |
19 | export ...
20 |
21 | components = {
22 | pwdfield: Pwdfield
23 | }
24 | ```
25 |
26 | ```vue
27 |
28 | ```
29 | 默认是选择数字,从`1`到`4`,颜色是`#444751`
30 |
31 | ## 配置 Options
32 |
33 | ### Api
34 |
35 | | 参数 | 说明 | 类型 | 可选值 | 默认值 |
36 | | -------- | ---------------- | --------------- | ----------- | ------- |
37 | | sixdig | 开启六位数 | Boolean | - | - | false
38 | | display | 明密文 | Boolean | - | true |
39 | | color | 边框颜色 | String | - | #444751 |
40 |
41 | ### Event
42 |
43 | | 参数 | 说明 | 返回值 |
44 | | --------- | -------- | ---------------- |
45 | | value | 实时获取填写变化 | String |
46 |
--------------------------------------------------------------------------------
/wepy.config.js:
--------------------------------------------------------------------------------
1 | const path = require('path');
2 | var prod = process.env.NODE_ENV === 'production'
3 |
4 | module.exports = {
5 | wpyExt: '.wpy',
6 | build: {
7 | web: {
8 | htmlTemplate: path.join('src', 'index.template.html'),
9 | htmlOutput: path.join('web', 'index.html'),
10 | jsOutput: path.join('web', 'index.js')
11 | }
12 | },
13 | resolve: {
14 | alias: {
15 | '@': path.join(__dirname, 'src')
16 | },
17 | modules: ['node_modules']
18 | },
19 | eslint: true,
20 | compilers: {
21 | babel: {
22 | sourceMap: true,
23 | presets: [
24 | 'env'
25 | ],
26 | plugins: [
27 | 'transform-class-properties',
28 | 'transform-decorators-legacy',
29 | 'transform-object-rest-spread',
30 | 'transform-export-extensions',
31 | ]
32 | }
33 | },
34 | plugins: {
35 | },
36 | appConfig: {
37 | noPromiseAPI: ['createSelectorQuery']
38 | }
39 | }
40 |
41 | if (prod) {
42 |
43 | delete module.exports.compilers.babel.sourcesMap;
44 |
45 | // 压缩js
46 | module.exports.plugins = {
47 | uglifyjs: {
48 | filter: /\.js$/,
49 | config: {
50 | }
51 | },
52 | imagemin: {
53 | filter: /\.(jpg|png|jpeg)$/,
54 | config: {
55 | jpg: {
56 | quality: 80
57 | },
58 | png: {
59 | quality: 80
60 | }
61 | }
62 | }
63 | }
64 | }
65 |
--------------------------------------------------------------------------------
/pwdfield.wpy:
--------------------------------------------------------------------------------
1 |
2 |
5 |
11 |
15 |
18 | {{display ? currentValue[i] : secret[i]}}
19 |
20 |
21 |
22 |
23 |
24 |
58 |
59 |
96 |
--------------------------------------------------------------------------------