Advertisement
doaw89t76g3bfi3wfw3a

Untitled

Jan 19th, 2018
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 0.82 KB | None | 0 0
  1. <div class="row" id="index-list">
  2. <div class="row">
  3.     <div class="collection">
  4.         <a :href="l.link" class="collection-item" v-for="l in list.array">{{l.title}}</a>
  5.      </div>
  6. </div>
  7. <div class="row" v-html="pagination"></div>
  8. </div>
  9. <script>
  10.  
  11. </script>
  12. <script>
  13.  
  14. var Vue_Listing = new Vue({
  15.   el: '#index-list',
  16.   data: {
  17.     pagination: null,
  18.     list: [],
  19.     page:1,
  20.   },
  21.   methods:{
  22.       getAll:function(page){
  23.           page = page ? page : 1;
  24.           this.$http.get(site_url(`ost/api/all?p=${page}`))
  25.           .then(function(resp){
  26.               console.log(resp);
  27.               this.pagination = resp.body.links;
  28.               this.list = resp.body;
  29.           }, function(error){
  30.               alert(error.statusText);
  31.           });
  32.       },
  33.       try:function(){
  34.           alert('nnna');
  35.           return false;
  36.       },
  37.   },
  38.   mounted:function(){
  39.     this.getAll();
  40.   }
  41. });
  42.  
  43. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement