Skip to content
\n

When I load the page, I see the following errors in the console:

\n\n

This is what the whole page looks like:
\n\"image\"

\n

Now as soon as I remove the 'to' prop and use 'href' in the below line the page looks as how it is supposed to look.
\n<b-nav-item to=\"/admin/product/list\">Products</b-nav-item>

\n

This is what the page looks like now:
\n\"image\"

\n

Versions

\n\n

Environment:

\n","upvoteCount":1,"answerCount":6,"acceptedAnswer":{"@type":"Answer","text":"

Nevermind, I forked the codesandbox and removed core-js which removed all the errors.

\n

The issue you're having is because of the unscoped styles found in pages/index.vue.
\nMainly the styling applied to .container

\n
.container {\n  margin: 0 auto;\n  min-height: 100vh;\n  display: flex;\n  justify-content: center;\n  align-items: center;\n  text-align: center;\n}
\n

When you don't use scoped on your <style> tags, in a component it will bleed into other components/pages. To avoid this you have to add scoped to the <style> tag. <style scoped>.

\n

The reason this is only happening when using the to drop, is because the to prop renderes a <nuxt-link>, which doesn't cause a page redirect, but instead just swaps out the content on the page. Meaning the style from the index.vue page is still loaded, and is now affecting your other page too since you're not using <scoped>.

","upvoteCount":1,"url":"https://github.com/bootstrap-vue/bootstrap-vue/discussions/6258#discussioncomment-247186"}}}
Discussion options

You must be logged in to vote

Nevermind, I forked the codesandbox and removed core-js which removed all the errors.

The issue you're having is because of the unscoped styles found in pages/index.vue.
Mainly the styling applied to .container

.container {
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
}

When you don't use scoped on your <style> tags, in a component it will bleed into other components/pages. To avoid this you have to add scoped to the <style> tag. <style scoped>.

The reason this is only happening when using the to drop, is because the to prop renderes a <nuxt-link>, which doesn't cause a page redirect, but instead just swaps…

Replies: 6 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by platput
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@Hiws
Comment options

Hiws Aug 1, 2022
Maintainer

@KalubowilaDMR
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants
Converted from issue

This discussion was converted from issue #6258 on December 28, 2020 10:51.