Merge pull request #2324 from SergioCrisostomo/auto-complete
normalize autocomplete and spellcheck
This commit is contained in:
commit
32e8393a19
6 changed files with 28 additions and 5 deletions
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<form :class="classes"><slot></slot></form>
|
||||
<form :class="classes" :autocomplete="autocomplete"><slot></slot></form>
|
||||
</template>
|
||||
<script>
|
||||
// https://github.com/ElemeFE/element/blob/dev/packages/form/src/form.vue
|
||||
|
@ -32,6 +32,12 @@
|
|||
showMessage: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
autocomplete: {
|
||||
validator (value) {
|
||||
return oneOf(value, ['on', 'off']);
|
||||
},
|
||||
default: 'off'
|
||||
}
|
||||
},
|
||||
data () {
|
||||
|
@ -67,14 +73,14 @@
|
|||
}
|
||||
if (++count === this.fields.length) {
|
||||
// all finish
|
||||
resolve(valid)
|
||||
resolve(valid);
|
||||
if (typeof callback === 'function') {
|
||||
callback(valid);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
})
|
||||
});
|
||||
},
|
||||
validateField(prop, cb) {
|
||||
const field = this.fields.filter(field => field.prop === prop)[0];
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
:class="inputClasses"
|
||||
:disabled="disabled"
|
||||
autocomplete="off"
|
||||
spellcheck="false"
|
||||
:autofocus="autofocus"
|
||||
@focus="focus"
|
||||
@blur="blur"
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
<input
|
||||
:id="elementId"
|
||||
:autocomplete="autocomplete"
|
||||
:spellcheck="spellcheck"
|
||||
ref="input"
|
||||
:type="type"
|
||||
:class="inputClasses"
|
||||
|
@ -34,6 +35,7 @@
|
|||
v-else
|
||||
:id="elementId"
|
||||
:autocomplete="autocomplete"
|
||||
:spellcheck="spellcheck"
|
||||
ref="textarea"
|
||||
:class="textareaClasses"
|
||||
:style="textareaStyles"
|
||||
|
@ -116,6 +118,10 @@
|
|||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
spellcheck: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
autocomplete: {
|
||||
validator (value) {
|
||||
return oneOf(value, ['on', 'off']);
|
||||
|
|
|
@ -7,7 +7,13 @@
|
|||
</div>
|
||||
<div v-if="showElevator" :class="ElevatorClasses">
|
||||
{{ t('i.page.goto') }}
|
||||
<input type="text" :value="_current" @keyup.enter="changePage">
|
||||
<input
|
||||
type="text"
|
||||
:value="_current"
|
||||
autocomplete="off"
|
||||
spellcheck="false"
|
||||
@keyup.enter="changePage"
|
||||
>
|
||||
{{ t('i.page.p') }}
|
||||
</div>
|
||||
</div>
|
||||
|
@ -98,4 +104,4 @@
|
|||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
</script>
|
||||
|
|
|
@ -10,6 +10,8 @@
|
|||
<input
|
||||
type="text"
|
||||
:value="currentPage"
|
||||
autocomplete="off"
|
||||
spellcheck="false"
|
||||
@keydown="keyDown"
|
||||
@keyup="keyUp"
|
||||
@change="keyUp">
|
||||
|
|
|
@ -21,6 +21,8 @@
|
|||
:class="[prefixCls + '-input']"
|
||||
:placeholder="showPlaceholder ? localePlaceholder : ''"
|
||||
:style="inputStyle"
|
||||
autocomplete="off"
|
||||
spellcheck="false"
|
||||
@blur="handleBlur"
|
||||
@keydown="resetInputState"
|
||||
@keydown.delete="handleInputDelete"
|
||||
|
|
Loading…
Add table
Reference in a new issue