mirror of
https://github.com/getbible/app.git
synced 2024-12-22 07:48:55 +00:00
created hook to get the available translations
This commit is contained in:
parent
1a8c3add7a
commit
3c222f8261
@ -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>
|
Loading…
Reference in New Issue
Block a user