How does vue.js merge multiple configurations?

problem description

this is what I wrote on index.html:

<html>
<body>
  <div id="app">
    <sidenav>...</sidenav>
    <navbar>...</navbar>
  </div>
<script src="main.js"/>
</body>
</html>

main.js:

const app = new Vue({
  el: "-sharpapp",
  data: {...},
  method: {...}
});

some data and method, of navbar and sidenav are defined in vue app in main.js. I think this configuration can be used on other pages.
for example, in profile.html:

<html>
<body>
  <div id="app">
    <sidenav>...</sidenav>
    <navbar>...</navbar>
    
    {{ content... }}
  </div>
<script src="profile.js"/>
</body>
</html>

I hope to use app, in main.js in profile, but also have my own vue configuration in profile, for example:
profile.js:

const profile = new Vue({
   el: "-sharpapp",
   data: {...},
   method: {...}
});

is there any way to merge the two configurations

methods you have tried

I just started writing navbar and sidenav as single-file components, but I can"t use data and methods in other pages

Mar.25,2021

Save the data of navbar and sidenav to vuex.

Menu