feat(input): maxlength

This commit is contained in:
07akioni 2019-07-04 11:01:06 +08:00
parent d9273efe2f
commit 2126785d3d
4 changed files with 12 additions and 6 deletions

View File

@ -61,6 +61,7 @@ export default {
type="password" type="password"
size="large" size="large"
icon="md-person" icon="md-person"
maxlength="16"
/> />
<br> <br>
value: {{ value }} value: {{ value }}

View File

@ -2,7 +2,7 @@
<div class="demo"> <div class="demo">
<n-nimbus-service-layout <n-nimbus-service-layout
icon="md-contacts" icon="md-contacts"
name="NAIVE UI (0.1.87)" name="NAIVE UI (0.1.88)"
:padding-body="false" :padding-body="false"
:items="items" :items="items"
> >

View File

@ -1,6 +1,6 @@
{ {
"name": "naive-ui", "name": "naive-ui",
"version": "0.1.87", "version": "0.1.88",
"description": "", "description": "",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {

View File

@ -16,8 +16,8 @@
:value="value" :value="value"
:disabled="disabled === true" :disabled="disabled === true"
v-on="$listeners" v-on="$listeners"
@blur="$listeners.blur" @blur="$listeners.blur ? $listeners.blur : false"
@focus="$listeners.focus" @focus="$listeners.focus ? $listeners.focus : false"
@input="handleInput" @input="handleInput"
/> />
</div> </div>
@ -39,8 +39,9 @@
:placeholder="placeholder" :placeholder="placeholder"
:value="value" :value="value"
:disabled="disabled === true" :disabled="disabled === true"
@blur="$listeners.blur" :maxlength="maxlength"
@focus="$listeners.focus" @blur="$listeners.blur ? $listeners.blur : false"
@focus="$listeners.focus ? $listeners.focus : false"
@input="handleInput" @input="handleInput"
> >
<div <div
@ -96,6 +97,10 @@ export default {
icon: { icon: {
type: String, type: String,
default: null default: null
},
maxlength: {
type: [String, Number],
default: 'false'
} }
}, },
methods: { methods: {