Sha256: b4fdf02dc34801ed2f9917a7069e915bd22790d15832ecb23df4744f548f46e1
Contents?: true
Size: 1.42 KB
Versions: 16
Compression:
Stored size: 1.42 KB
Contents
<template> <div class="search-form"> <form v-on:submit.prevent="onSubmit" class="pure-form"> <multiselect placeholder="mention" v-model="person" :options="people" track-by="id" label="identifier" :multiple="false" :taggable="true" @tag="addPeople" class="input-multiselect" selectLabel="" deselect-label="" :loading="isLoading" @search-change="asyncFind" ></multiselect> <button type="submit"><i class="fas fa-filter"></i></button> </form> </div> </template> <script> import app from '../configs/app' import Multiselect from 'vue-multiselect' export default { name: 'People', props: [], components: { Multiselect }, data () { return { person: null, people: [], isLoading: false, } }, methods: { asyncFind (query) { this.isLoading = true; let self = this; this.$http.get(app.host + '/modules/people/search/?person=' + encodeURIComponent(query)) .then(function(response){ console.log(query) self.people = response.data self.isLoading = false }); }, addPeople (newPerson) { const person = { name: newPerson, } this.people.push(person) }, onSubmit () { if (this.person.id != '') { this.$router.push({ name: 'mention', params: { id: this.person.id, identifier: this.person.identifier }}) } else { } }, }, created() { }, filters: { }, watch: { } } </script>
Version data entries
16 entries across 16 versions & 1 rubygems