|
1 | | -## Welcome to GitHub Pages |
| 1 | +# Vue custom input   |
2 | 2 |
|
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. |
4 | 4 |
|
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 | + |
6 | 6 |
|
7 | | -### Markdown |
| 7 | +## Demo |
8 | 8 |
|
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/) |
10 | 10 |
|
11 | | -```markdown |
12 | | -Syntax highlighted code block |
| 11 | +## Installation |
13 | 12 |
|
14 | | -# Header 1 |
15 | | -## Header 2 |
16 | | -### Header 3 |
17 | | - |
18 | | -- Bulleted |
19 | | -- List |
| 13 | +```bash |
| 14 | +npm i vue-custom-input -S |
| 15 | +``` |
20 | 16 |
|
21 | | -1. Numbered |
22 | | -2. List |
| 17 | +## Usage |
23 | 18 |
|
24 | | -**Bold** and _Italic_ and `Code` text |
| 19 | +### use in vue single file components |
25 | 20 |
|
26 | | -[Link](url) and  |
| 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> |
27 | 62 | ``` |
28 | 63 |
|
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 |
34 | 65 |
|
35 | | -### Support or Contact |
| 66 | +#### Vue custom input component attributes: |
36 | 67 |
|
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