4
2
Fork 0

created hook to get the available translations

This commit is contained in:
Erastus Amunwe 2020-10-26 16:50:45 +02:00
parent 1a8c3add7a
commit 3c222f8261
1 changed files with 30 additions and 1 deletions

View File

@ -14,4 +14,33 @@
</div>
</nav>
</template>
</template>
<script>
export default {
data: () => {
return {
translations: {},
}
},
async created(){
let config = {
headers: {'Access-Control-Allow-Origin': '*'}
};
let response =fetch(`https://getbible.net/v2/translations.json`,config)
.catch(function(err) { this.translations = err });
if(!response)
return;
let data = response.json().catch(err => {console.log(err);})
if(!data)
return;
this.translations = data
}
}
</script>