Created
January 2, 2018 17:47
-
-
Save naeluh/9382578fa98c5c725d8b7e3921aed2ea to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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