Skip to content

Commit 7372549

Browse files
committed
complete readme
1 parent 965b9ca commit 7372549

File tree

1 file changed

+69
-24
lines changed

1 file changed

+69
-24
lines changed

README.md

Lines changed: 69 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,82 @@
1-
## Welcome to GitHub Pages
1+
# Vue custom input ![version](https://img.shields.io/badge/version-%20v1.0.0%20-green.svg) ![vue](https://img.shields.io/badge/vue-%20v2.1%20-green.svg)
22

3-
You can use the [editor on GitHub](https://github.com/Youjingyu/vue-custom-input/edit/master/README.md) to maintain and preview the content for your website in Markdown files.
3+
Vue custom input is a vue component for custom split input box, mobile web input box, simulating native app input box and etc. It's designed to input password and verification code. But you can also use it in other situation as you wish.
44

5-
Whenever you commit to this repository, GitHub Pages will run [Jekyll](https://jekyllrb.com/) to rebuild the pages in your site, from the content in your Markdown files.
5+
![](https://github.com/Youjingyu/vue-custom-input/tree/master/dist/example/example.gif)
66

7-
### Markdown
7+
## Demo
88

9-
Markdown is a lightweight and easy-to-use syntax for styling your writing. It includes conventions for
9+
[https://wangdahoo.github.io/vue-scroller/](https://wangdahoo.github.io/vue-scroller/)
1010

11-
```markdown
12-
Syntax highlighted code block
11+
## Installation
1312

14-
# Header 1
15-
## Header 2
16-
### Header 3
17-
18-
- Bulleted
19-
- List
13+
```bash
14+
npm i vue-custom-input -S
15+
```
2016

21-
1. Numbered
22-
2. List
17+
## Usage
2318

24-
**Bold** and _Italic_ and `Code` text
19+
### use in vue single file components
2520

26-
[Link](url) and ![Image](src)
21+
```html
22+
<template>
23+
<custom-input
24+
input-height="50px"
25+
:input-number="4"
26+
input-type="number"
27+
input-style-type="oneBorder"
28+
@custom-input-change="change"
29+
@custom-input-complete="complete">
30+
</custom-input>
31+
</template>
32+
<script>
33+
import customInput from 'vue-custom-input';
34+
export default {
35+
components: { 'custom-input': customInput },
36+
methods: {
37+
change(val) {
38+
39+
},
40+
complete(val) {
41+
42+
}
43+
}
44+
}
45+
</script>
46+
```
47+
### use in browser globals
48+
```html
49+
<div id="app">
50+
<custom-input></custom-input>
51+
</div>
52+
<script src="vue.js"></script>
53+
<script src="vue-custom.js"></script>
54+
<script>
55+
new Vue({
56+
el: '#app',
57+
components: {
58+
'custom-input': window.customInput
59+
}
60+
});
61+
</script>
2762
```
2863

29-
For more details see [GitHub Flavored Markdown](https://guides.github.com/features/mastering-markdown/).
30-
31-
### Jekyll Themes
32-
33-
Your Pages site will use the layout and styles from the Jekyll theme you have selected in your [repository settings](https://github.com/Youjingyu/vue-custom-input/settings). The name of this theme is saved in the Jekyll `_config.yml` configuration file.
64+
## API
3465

35-
### Support or Contact
66+
#### Vue custom input component attributes:
3667

37-
Having trouble with Pages? Check out our [documentation](https://help.github.com/categories/github-pages-basics/) or [contact support](https://github.com/contact) and we’ll help you sort it out.
68+
| Attr. Name | Description | Required | Type | Default Value |
69+
|-----|-----|-----|-----|-----|
70+
| custom-input-change | called when input value is changed | N | Function | - |
71+
| custom-input-complete | called when all input boxes are filled | N | Function | - |
72+
| input-number | input box number | N | Number | 4 |
73+
| input-style-type | two preset styles. You can also design your style by the following attributes | N | 'allBorder', 'oneBorder' | 'allBorder' |
74+
| input-type | just like html5 input type attribute, can be tel, number, text and etc. | N | String | 'text' |
75+
| password-char | the character showed in input box when the input-type is password | N | String | '*' |
76+
| input-width | input box width | N | String | - |
77+
| input-height | input box height | N | String | '50px' |
78+
| input-border-width | input box border width | N | String | '1px' |
79+
| input-border-color | input box border color | N | String | '#20A0FF' |
80+
| input-active-outline-color | input box outline color when focus on it | N | String | '#58B7FF' |
81+
| input-style | customize input box style as you want. All styles will be injected into box's style attribute | N | Object | {} |
82+
| input-active-style | input box style when focus on it. | N | Object | {} |

0 commit comments

Comments
 (0)