Trying to find a way to store my Vue templates in variables for routing purposes.
I've set up an App.vue file with just a simple HTML title (for testing), and a main.js file with an 'import' statement that I haven't used in JavaScript before. However, every documentation suggests this method as the way to go for getting a template file's content into a variable.
Unfortunately, when using the 'import' command, I encounter the following error: "Uncaught SyntaxError: Unexpected token import."
The import line causing the issue is: "import App from '../vues/App';"
I've double-checked the path, but if there's another way to achieve storing a template file's content in a JS variable, I would appreciate any guidance.
Thank you for your help.
EDIT: main.js
import App from '../vues/App';
new Vue({
el: '#app',
template: '<App/>',
components: { App }
});
App.vue:
<template>
<h1>Hello World!</h1>
</template>
<script>
export default {}
</script>