Skip to content
This repository has been archived by the owner on Feb 24, 2024. It is now read-only.

[bug]Not Work with native vue-router router-link #5

Closed
milkmeowo opened this issue Mar 6, 2019 · 2 comments
Closed

[bug]Not Work with native vue-router router-link #5

milkmeowo opened this issue Mar 6, 2019 · 2 comments

Comments

@milkmeowo
Copy link

const routerContentMatch = content.match(/<router([^>]*)>([\S\s.]*?)<\/router>/)
if (routerContentMatch) {
const [, attrs, content] = routerContentMatch
return {
content,
attrs
}
}
return null
}

because of /<router([^>]*)>([\S\s.]*?)<\/router>/, also work with <router-link>
so routerContentMatch get incorrect content

example

<template>
  <div>
    <router-link to="path">
      some-path-name
    </router-link>  
  </div>
</template>
<router>
  meta:
    name: foo
</router>

notice: <router([^>]*)> match <router-link> ,or may be <router-view>

image

well,yes i can use nuxt-link instead of router-link,to avoid this bug

but i think should support native vue-router component, right?

@farnabaz
Copy link
Member

farnabaz commented Mar 6, 2019

Sure, you're right. We should fix the regex

@milkmeowo
Copy link
Author

nice!

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

No branches or pull requests

2 participants