You can do the following: all that is in the template is set up as a separate component, and called it in the right places, and the data in it passed through props . Example:
//файл main.vue <template> <div> <my-component :dataComponent="temp"></my-component> </div> </template> <script> import myComponent from './my_component.vue' export default { components: [myComponent], data () { return { temp: { a: 1, b: 2 } } } } </script> //файл my_component.vue <template> <div> {{dataComponent.a}} + {{dataComponent.b}} = 3 </div> </template> <script> export default { props: ['dataComponent'] } </script>
props can read in the documentation
PS: this is a very simplified example.