0

I want to create a static header, with some links that change a vue app like a SPA. I know how to do this within the main app, but how can it be achieved outside of it, in a static header for example?

App being the main vue instance.

<body>
    <div id="header">
       <a href="" id="link_to_change_app_view"></a>
    </div>
    <div id="#app"></div>
</body>
1
  • well you can't that's why you put everything inside the app or mount your app to the body. If you want a static header just place it above your router view and there you go Commented Jul 11, 2017 at 11:13

1 Answer 1

1

As claimed in the comments you can simply put your static header inside your app

<div id="#app">
   <!-- static -->
   <div id="header">
     <router-link to="" id="link_to_change_app_view" />
   </div>

   <!-- dynamic -->
   <router-view></router-view>
</div>

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.