Newer
Older
type="text"
placeholder="Rechercher un projet ..."
@input="searchProjects"
import { debounce } from 'lodash';
import { mapActions, mapMutations } from 'vuex';
...mapMutations('projects', [
'SET_CURRENT_PAGE'
]),
...mapActions('projects', [
'SEARCH_PROJECTS'
]),
searchProjects:
debounce(function(e) {
this.$emit('loading', true);
this.SET_CURRENT_PAGE(1);
this.SEARCH_PROJECTS({ text: e.target.value })
.then(() => {
this.$emit('loading', false);
})
.catch((err) => {
if (err.message) {
this.$emit('loading', false);
}
});
}, 100)
display: flex;
flex-direction: column;
justify-content: flex-end;
text-align: left;
color: #35495e;
font-family: var(--font-family, 'Roboto Condensed', 'Lato', 'Helvetica Neue', Arial, Helvetica, sans-serif);
}
input:focus {
outline: none !important;
box-shadow: 0 0 1px grey;