0
- You use
new Vue()
in JavaScript files andexport default {…}
in Vue files, with the.vue
extension. A build tool will convert the Vue file to JavaScript and the code converted to Vue components. - The Vue single component file is generally used, but you can use the
Vue()
syntax if you don’t want to use build tools. - In a Vue file, you’re creating a single component. If you want to do manipulations, you should do it inside the component, there’s no need to assign the component to a variable.
- You can use
new Vue()
and Vue files together, but I think it’s better to stick to one way of thinking. I recommend using Vue files with theexport default {…}
syntax.
Source:stackexchange.com