[Vuejs]-Determing when to use data structure approaches in Vue.js

0👍

✅

  1. You use new Vue() in JavaScript files and export 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.
  2. The Vue single component file is generally used, but you can use the Vue() syntax if you don’t want to use build tools.
  3. 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.
  4. 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 the export default {…} syntax.

Leave a comment