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

Refresh: optional callback #102

Open
Venatum opened this issue May 20, 2021 · 0 comments
Open

Refresh: optional callback #102

Venatum opened this issue May 20, 2021 · 0 comments

Comments

@Venatum
Copy link

Venatum commented May 20, 2021

First of all, thank you for your great work !

Using the refresh function, I discovered that the callback was not optional. I think it's just an oversight of an if.

vue-horizontal.vue#L240

/**
 * Manually refresh vue-horizontal
 * @param callback after refreshed, optional
 */
refresh(callback: (data: VueHorizontalData) => void): void {
    this.$nextTick(() => {
        const data = this.calculate()
        this.left = data.left
        this.width = data.width
        this.scrollWidth = data.scrollWidth
        this.hasNext = data.hasNext
        this.hasPrev = data.hasPrev
        callback(data)
    })
},
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

1 participant