Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Paginator.vue issue with new reply #12

Open
FHoulbreque opened this issue May 15, 2017 · 2 comments
Open

Paginator.vue issue with new reply #12

FHoulbreque opened this issue May 15, 2017 · 2 comments

Comments

@FHoulbreque
Copy link

FHoulbreque commented May 15, 2017

Hello,

Your new component just created in the latest lesson introduced an issue.

When you create a reply (with pagination set to 1 reply), the reply show up on the page with the one previously shown (so 2 are displayed despite the pagination should only return one).

This issue it there as well when you delete a Reply leaving a blank page.

Maybe will we need inter-component event there to monitor new post and flush datas?

What would you think?

Thanks for this tut anyway.

@FHoulbreque
Copy link
Author

FHoulbreque commented May 17, 2017

I hacked your Collection.js file but it's only a quick fix as it don't show any clue about current update status, and if your local server is slow, it could lead to strange behaviour.

I just suggest this as it could make the user experience more agreeable.

Here's how I changed the file :

export default {
    data() {
        return {
            items: [],
        }
    },

    methods: {
        add(item) {
            // this.items.push(item);
            let page = Math.ceil((this.dataSet.total + 1) / this.dataSet.per_page);
            this.fetch(page);
            this.$emit('added');
        },
        remove(index) {
            // this.items.splice(index, 1);
            this.fetch(this.dataSet.current_page);
            this.$emit('removed');
        }
    }

}

@GabMic
Copy link

GabMic commented May 18, 2017

I have just seen the same thing, and made a small .gif to show it:
r

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants