Skip to content

Trouble importing router #74

Closed Answered by FranckFreiburger
tinus asked this question in Q&A
Discussion options

You must be logged in to vote

vue-router works properly with vue3-sfc-loader. Here an example for vue2 :

<!DOCTYPE html>
<html>
<body>
  <div id="app"></div>
  <script src="https://unpkg.com/vue@2/dist/vue.js"></script>
  <script src="https://cdn.jsdelivr.net/npm/vue3-sfc-loader/dist/vue2-sfc-loader.js"></script>
  <script src="https://unpkg.com/[email protected]/dist/vue-router.js"></script>
  <script>

    /* <!-- */
    const config = {
      files: {
        '/app.vue': `
          <template>
            <div>
              <div><router-link to="/foo">go to /foo</router-link></div>
              <div><router-link to="/bar">go to /bar</router-link></div>
              <router-view/>
            </div>
          </te…

Replies: 2 comments 4 replies

Comment options

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

You must be logged in to vote
4 replies
@tinus
Comment options

@tinus
Comment options

@paul-hammant
Comment options

@tinus
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
3 participants