I'm working with code in vuejs :
created() {
var id = this.id
axios
.get("/api/product" + id)
.then((res) => {
this.rows = res.data;
})
.catch((error) => {
console.log(error);
});
},
methods: {
changeValue() {
axios
.get("/api/product" + id, {
params: {
status: this.status,
},
})
.then((res) => {
this.rows = res.data;
})
.catch((error) => {
console.log(error);
});
}
}
template :
<v-select
:options="options"
v-model="status"
@input="changeValue()"
/>
My problem is when i get the res.data
in my methods
this.rows = res.data
. When i console.log(this.rows)
it shows the correct result i want to display.But it still shows this.row
in created()
.Is there a way to override this.rows in created()
? Thanks