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.
<template>
<ul class="social-links">
<li v-for="item in socials" :key="item.id">
<g-link :to="item.url">
<component :is="item.icon"></component>
</g-link>
</li>
</ul>
</template>
<script>
import Facebook from '~/assets/svg/facebook.svg';
import Twitter from '~/assets/svg/twitter.svg';
import Instagram from '~/assets/svg/instagram.svg';
console.log(Facebook);
export default {
data () {
return {
socials: [
{
id: 1,
icon: Facebook,
url: "https://www.facebook.com",
},
{
id: 2,
icon: Twitter,
url: "https://www.twitter.com",
},
{
id: 3,
icon: Instagram,
url: "https://www.instagram.com",
}
]
}
},
components: {
Facebook,
Twitter,
Instagram
}
}
</script>
<style lang="scss">
</style>