Skip to content

Instantly share code, notes, and snippets.

@naeluh
Created January 2, 2018 17:47
Show Gist options
  • Save naeluh/9382578fa98c5c725d8b7e3921aed2ea to your computer and use it in GitHub Desktop.
Save naeluh/9382578fa98c5c725d8b7e3921aed2ea to your computer and use it in GitHub Desktop.
<template>
<div id="app">
<router-view :arr="bookData"></router-view>
</div>
</template>
<script>
import axios from 'axios'
import store from './router/store'
export default {
name: 'app',
props: ['arr'],
data () {
return {
bookData: []
}
},
methods: {
array () {
let url = '://example.com?api=sdfsdf'
return axios.get(url)
.then((res) => {
this.bookData = res.data.feed.entry
store.dispatch('books', this.bookData)
})
}
},
created () {
this.array()
}
}
</script>
<style scoped>
#app {}
</style>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment