vue v-model refactoring for mobile phones
This commit is contained in:
parent
e2490b9e60
commit
f18f83b110
@ -26,9 +26,9 @@
|
|||||||
autocapitalize="default" autocorrect="ON"
|
autocapitalize="default" autocorrect="ON"
|
||||||
:placeholder="placeholder"
|
:placeholder="placeholder"
|
||||||
:ref="'input-contact-field-' + _uid"
|
:ref="'input-contact-field-' + _uid"
|
||||||
v-model="search"
|
:value="search"
|
||||||
@input="onInput"
|
@input="onInput($event)"
|
||||||
@keyup.enter="onInput"
|
@keyup.enter="onInput($event)"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -304,7 +304,9 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
onInput() {
|
onInput(event) {
|
||||||
|
this.search = event.target.value;
|
||||||
|
|
||||||
window.axios.get(this.searchRoute + '?search="' + this.search + '" enabled:1 limit:10')
|
window.axios.get(this.searchRoute + '?search="' + this.search + '" enabled:1 limit:10')
|
||||||
.then(response => {
|
.then(response => {
|
||||||
this.contact_list = [];
|
this.contact_list = [];
|
||||||
|
@ -18,8 +18,8 @@
|
|||||||
autocapitalize="default"
|
autocapitalize="default"
|
||||||
autocorrect="ON"
|
autocorrect="ON"
|
||||||
:placeholder="placeholder"
|
:placeholder="placeholder"
|
||||||
v-model="search"
|
:value="search"
|
||||||
@input="onInput"
|
@input="onInput($event)"
|
||||||
:ref="'input-item-field-' + _uid"
|
:ref="'input-item-field-' + _uid"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
@ -213,7 +213,9 @@ export default {
|
|||||||
}.bind(this), 100);
|
}.bind(this), 100);
|
||||||
},
|
},
|
||||||
|
|
||||||
onInput() {
|
onInput(event) {
|
||||||
|
this.search = event.target.value;
|
||||||
|
|
||||||
//to optimize performance we kept the condition that checks for if search exists or not
|
//to optimize performance we kept the condition that checks for if search exists or not
|
||||||
if (!this.search) {
|
if (!this.search) {
|
||||||
return;
|
return;
|
||||||
|
@ -16,8 +16,8 @@
|
|||||||
autocapitalize="default"
|
autocapitalize="default"
|
||||||
autocorrect="ON"
|
autocorrect="ON"
|
||||||
:placeholder="placeholder"
|
:placeholder="placeholder"
|
||||||
v-model="search"
|
:value="search"
|
||||||
@input="onInput"
|
@input="onInput($event)"
|
||||||
:ref="'input-item-field-' + _uid"
|
:ref="'input-item-field-' + _uid"
|
||||||
@keydown.enter="inputEnterEvent"
|
@keydown.enter="inputEnterEvent"
|
||||||
/>
|
/>
|
||||||
@ -282,7 +282,9 @@ export default {
|
|||||||
}.bind(this), 100);
|
}.bind(this), 100);
|
||||||
},
|
},
|
||||||
|
|
||||||
onInput() {
|
onInput(event) {
|
||||||
|
this.search = event.target.value;
|
||||||
|
|
||||||
this.isItemMatched = false;
|
this.isItemMatched = false;
|
||||||
//to optimize performance we kept the condition that checks for if search exists or not
|
//to optimize performance we kept the condition that checks for if search exists or not
|
||||||
if (!this.search) {
|
if (!this.search) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user