Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- window.addEventListener('load', function() {
- window.vue = new Vue({
- el: "#product-list-page",
- name: 'Product',
- data: {
- items: [],
- productFilter: '',
- seen: true,
- geoloc: false,
- options: null
- },
- computed: {
- productList () {
- return this.items.slice(0, this.items.length);
- },
- mainProductList () {
- return this.items.slice(0, 4);
- }
- },
- methods: {
- getNewList() {
- this.seen = true;
- setTimeout(function () { this.items = jsonData; this.geoloc = jsonGeoLoc; this.seen = false; }.bind(this), 2000);
- setTimeout(function () {
- try {
- var $owl = $('.main-recommended > .products > .owl-carousel');
- $owl.trigger('destroy.owl.carousel');
- $owl.html($owl.find('.owl-stage-outer').html()).removeClass('owl-loaded');
- $owl.owlCarousel({
- loop: false,
- margin: 0,
- nav: true,
- stagePadding: 0,
- responsive: {
- 0: { items: 1 },
- 480: { items: 1 },
- 768: { items: 2 },
- 1024: { items: 2 },
- 1170: { items: 4 }
- }
- });
- // $owl.trigger('refresh.owl.carousel');
- this.seen = false;
- } catch (error) {
- console.log(error);
- }
- }, 2100);
- }
- },
- created() {
- console.log(this.items);
- },
- mounted: function () {
- setTimeout(function () { this.getNewList(); }.bind(this), 2000);
- }
- });
Add Comment
Please, Sign In to add comment