Answer the question
In order to leave comments, you need to log in
How to display filter parameters in URL without reloading the page?
On auto ru, pagination and changing filter parameters do not reload the page.
There is a filter
<template>
<form>
<div>
<select v-model="filter.type_id" class="form-control" name="type_id">
<option v-for="type in types" v-bind:key="type.id" v-bind:value="type.id">{{type.name}}</option>
</select>
</div>
<div class="submit">
<button type="submit" @click.prevent="fetch" class="btn">
Результаты
</button>
</div>
</form>
</template>
<script>
export default {
data() {
return {
filter: {
type_id:null,
},
}
},
methods: {
fetch() {
axios.get(url, {
params: {
type_id: this.filter.type_id,
}
})
}
}
}
</script>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question