Answer the question
In order to leave comments, you need to log in
How to send year and get real time data?
Good afternoon.
The page has a select field with a year selection.
How to add a year to an axios request so that when the year changes, the received information is also updated?
<script>
import axios from 'axios'
export default {
data () {
return {
year: 2022,
error: '',
form: [],
}
}
mounted: function() {
axios
.get("http://example/" + this.year)
.then(response => {
this.form= response.data;
})
.catch(function(e){
this.error = e;
});
},
}
</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