jeneser / vue-scroll-behavior

Customize the scrolling position on route navigation. Especially hash mode.

Home Page:https://jeneser.github.io/vue-scroll-behavior

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Suggestion: Allow option to filter on routes

sebmor opened this issue · comments

There is already an option to ignore routes, but in the many cases where you only have one or a few pages that need the persist their scroll, it's often easier to only select these instead of ignoring all the rest.

I suggest a filter kind of option:

Vue.use(vueScrollBehavior, {
  filter: [/\/boo/, /\/zoo/],    // only apply on these routes,
})

Right, we just need a filter option to match our routes.
I marked it as a new feature for PR.

must have