Advertisement
Guest User

Untitled

a guest
Jul 19th, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <template>
  2.   <div>
  3.     <ul>
  4.       <li v-for="item in a.data" :key="item" />
  5.     </ul>
  6.   </div>
  7. </template>
  8. <script>
  9. import newsRepository from '../api/newsRepository'
  10.  
  11. export default {
  12.   data: () => ({
  13.     a: {}
  14.   }),
  15.   async asyncData() {
  16.     if (process.server) {
  17.       const a = await newsRepository.GetAllNews()
  18.       console.log(a)
  19.       return { a }
  20.     }
  21.   }
  22. }
  23. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement