Guest User

Untitled

a guest
Oct 18th, 2017
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.02 KB | None | 0 0
  1. window.addEventListener('load', function() {
  2. window.vue = new Vue({
  3. el: "#product-list-page",
  4. name: 'Product',
  5. data: {
  6. items: [],
  7. productFilter: '',
  8. seen: true,
  9. geoloc: false,
  10. options: null
  11. },
  12. computed: {
  13. productList () {
  14. return this.items.slice(0, this.items.length);
  15. },
  16. mainProductList () {
  17. return this.items.slice(0, 4);
  18. }
  19. },
  20. methods: {
  21. getNewList() {
  22. this.seen = true;
  23. setTimeout(function () { this.items = jsonData; this.geoloc = jsonGeoLoc; this.seen = false; }.bind(this), 2000);
  24. setTimeout(function () {
  25. try {
  26. var $owl = $('.main-recommended > .products > .owl-carousel');
  27. $owl.trigger('destroy.owl.carousel');
  28. $owl.html($owl.find('.owl-stage-outer').html()).removeClass('owl-loaded');
  29. $owl.owlCarousel({
  30. loop: false,
  31. margin: 0,
  32. nav: true,
  33. stagePadding: 0,
  34. responsive: {
  35. 0: { items: 1 },
  36. 480: { items: 1 },
  37. 768: { items: 2 },
  38. 1024: { items: 2 },
  39. 1170: { items: 4 }
  40. }
  41. });
  42. // $owl.trigger('refresh.owl.carousel');
  43. this.seen = false;
  44. } catch (error) {
  45. console.log(error);
  46. }
  47. }, 2100);
  48. }
  49. },
  50. created() {
  51. console.log(this.items);
  52. },
  53. mounted: function () {
  54. setTimeout(function () { this.getNewList(); }.bind(this), 2000);
  55. }
  56. });
Add Comment
Please, Sign In to add comment