0๐
If I understood correctly your question, this.item
is holding an object retrieved from the array. If is like this, it should be as easy as:
.get("items/" + this.item.id)
0๐
if you want to create new array you can do this at your return from axios
.then(res => {
let arr = res.data
this.xtra = arr.map(x =>
x.item.id)
})
0๐
First declare Items as reactive array in setup function
const tools = reactive([]);
Then in methods, retrieve
axios.get("/user-items").then(response => {
var items = [];
response.data.forEach((item, index) => {
items.push(item.id);
})
Object.assign(this.items, items);
});
Source:stackexchange.com