singleProduct(state, getters) {
return (id) => {
const product = getters.all.find((item) => {
return item.id.toString() === id
})
return product
}
}
created () {
fetch("https://api.agimonline.com/v1/properties/list/", {
method: "GET",
headers: {
"Access-Control-Allow-Origin": "*",
'Accept': 'application/json',
'Content-Type': 'application/json',
"X-Api-User": "###",
"X-Api-Pwd": "###,
"X-Api-Key": "###",
'Cache-Control': null,
'X-Requested-With': null
}
}
)
.then(res => res.json())
.then(data => console.log(data))
}
А доступа к серверу нету.
Access to fetch at 'https://api.agimonline.com/v1/properties/list/' from origin 'http://iconsulentiimmobiliari.cf' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
Определить динамически, когда $i будет равен 4, 7 , 10, 13, 16....