Notes: Use axios to call data and render in vue
Original link: https://zburu.com/archives/151.html Examples are as follows. <template> <div class=”posts”> <div v-for=”item in list” :key=”item.cid” > </div> </div> </template> <script> import Axios from ‘axios’; export default { name: ‘index’, data () { return { list: [] } }, methods: { getData () { var api = ‘https://zburu.com/api/posts.php’; Axios.get(api).then((response) => { this.list = response.data; console.log(response.data) }).catch((error) […]
Notes: Use axios to call data and render in vue Read More »