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

Regexp does not work

lokkomokko opened this issue · comments

I have route /website, in script write -
Vue.use(vueScrollBehavior, {
router: router,
maxLength: 100,
ignore: [//website/, //zoo/],
})

but it ignore my ignore, what Im doing wrong?

ignore: [/\/website/, /\/zoo/],

Have you solved it yet?
If you write like this: ignore: [/\/website/, /\/zoo/], it works well.
But, I don't rule out other factors. If you find these issues, please tell me and provide more relevant code. I'd be happy to make a change for it. I'd be happy to accept PR, too.
Thank you very much.

very strange, I solved this problem to manualy write in route js scroll behaviour that look at meta of components and if need scrolled it top, anyway thank you too! very good plugin

Yep, happy coding.

This is an old issue, but I´m struggling with the same problem.

I think the Problem is, that isIgnoreRoute is not returning any value:

/**
 * Is ignore route
 */
export function isIgnoreRoute (target) {
  vueScrollBehavior._ignore.some(e => {
    return target.fullPath.match(e)
  })
}

It works for me, when I change it to:

/**
 * Is ignore route
 */
export function isIgnoreRoute (target) {
  return vueScrollBehavior._ignore.some(e => {
    return target.fullPath.match(e)
  })
}