Boilerplate: Vue3 + Vite

Github repository: https://github.com/zrfvnzr/boilerplates_frontend/tree/hello_world_vue3_vite

  1. Created a Vue3 + Vite Project

    Related: Getting started with Vue 3 + Vite

  2. Delete the HelloWorld component

    Go to /src/components and the delete the file HelloWorld.vue

  3. Unlink and delete style.css

    In /src/main.js, delete the line import './style.css'

    Now in /src, delete the style.css file

  4. In /src/main.js, change the createApp lines to:

     const app = createApp(App)
     app.mount('#app')
    

    This allows easier use of app.mount and app.use lines

  5. Preparing the Options API syntax
    Related: https://markus.oberlehner.net/blog/vue-3-composition-api-vs-options-api/

    In /src/App.vue, remove the setup keyword from the <script> tag.

    Also delete the import HelloWorld from './components/HelloWorld.vue' line.
    Prepare the data and methods options:

<script>
export default {
  data() {
    return {
      // variables go here
    }
  },
  methods: {
    // methods go here
  }
}
</script>
  1. In /src/App.vue's <template>, delete initial code and leave a single main <div>.

    Also, delete the initial code in <style>.
    Additionally, we can remove the scoped attribute to make the styles in App.vue apply to all pages and components.

--END--