module.exports = {

    template: '<ul class="uk-pagination"></ul>',

    props: {
        page: {
            default: 0
        },

        pages: {
            default: 1
        }
    },

    created: function () {

        this.key = this.$parent.$options.name + '.pagination';

        if (this.page === null && this.$session.get(this.key)) {
            this.$set('page', this.$session.get(this.key));
        } else if (this.page === null) {
            this.page = 0;
        }

        this.$state('page', this.page ? this.page : undefined);

    },

    ready: function () {

        var vm = this;

        this.pagination = UIkit.pagination(this.$el, {pages: this.pages, currentPage: this.page});
        this.pagination.on('select.uk.pagination', function (e, page) {
            vm.$set('page', page);
        });

    },

    watch: {

        page: function (page) {
            this.pagination.selectPage(page);
            this.$session.set(this.key, page);
        },

        pages: function (pages) {
            this.pagination.render(pages);
        }

    }

};

@@ -415,76 +415,8 @@
    %7D
- else if (this.page === null) %7B%0A            this.page = 0;%0A        %7D
 %0A%0A  
@@ -454,32 +454,8 @@
 page
- ? this.page : undefined
 );%0A%0A
@@ -607,16 +607,21 @@
 his.page
+ %7C%7C 0
 %7D);%0A    
@@ -829,24 +829,29 @@
 ectPage(page
+ %7C%7C 0
 );%0A         
@@ -881,24 +881,29 @@
 is.key, page
+ %7C%7C 0
 );%0A        %7D

update pagination