joris

Component

Sep 5th, 2017
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <template>
  2.     <div class="container">
  3.         <div class="row">
  4.  
  5.             <div class="col-md-12" v-show="loading">
  6.                 <div class="lds-css ng-scope">
  7.                     <div style="width:100%;height:100%" class="lds-rolling">
  8.                         <div></div>
  9.                     </div>
  10.                 </div>
  11.             </div>
  12.  
  13.             <div class="ten columns">
  14.  
  15.                 <div id="responsive">
  16.                     <img v-for="itemx in slideItem" :key="itemx._id" v-bind:src="itemx.picture" data-caption="#htmlCaption" />
  17.                 </div>
  18.  
  19.                 <span class="orbit-caption" id="htmlCaption"><strong>I'm A Badass Caption:</strong> I can haz <a href="#">links</a>, <em>style</em> or anything that is valid markup :)</span>
  20.                
  21.             </div>
  22.         </div>
  23.     </div>
  24. </template>
  25.  
  26. <script>
  27. require('../assets/template/orbitslide/jquery.orbit-1.3.0.js');
  28. require('../assets/template/orbitslide/orbit-1.3.0.css');
  29. require('../assets/template/orbitslide/demo-style.css');
  30.  
  31. export default {
  32.    data() {
  33.        return {
  34.            slideItem: [],
  35.            loading: false
  36.        }
  37.    },
  38.    mounted: function () {
  39.        $('#featured').orbit({bullets: true});
  40.         $('#featured2').orbit({bullets: true});
  41.         $('#responsive').orbit({bullets: true, fluid: true});
  42.    },
  43.    beforeMount: function() {
  44.        this.loading = true
  45.        this.fetchSlide()
  46.    },
  47.    methods: {
  48.        fetchSlide: function() {
  49.            var urlSlide = 'http://private-anon-03776f44f8-frontendtest3.apiary-mock.com/headers';
  50.            
  51.             this.$http.get(urlSlide).then(responseSlide => {
  52.                 this.slideItem = responseSlide.data
  53.                 console.log(this.slideItem)
  54.                 this.loading = false
  55.             }, response => {
  56.                 this.$Progress.fail()
  57.                 this.loading = false
  58.             });
  59.         }
  60.     }
  61. }
  62. </script>
  63.  
  64. <style lang="scss">
  65. .container {
  66.     width: 100%;
  67.     height: 500px;
  68. }
  69. .orbit-bullets ul li {
  70.     margin-top: -200px;
  71. }
  72. </style>
Add Comment
Please, Sign In to add comment