Logo Vue

MeetUp Vue 2023

IntroducciΓ³n bΓ‘sica a Vue 3.

πŸ”— Links

vue router pinia vitest vuetify

πŸ’» Run Repository Locally

git NPM

Clone the project

  git clone https://github.com/Toyos90/meetup-vue

Go to the project directory

  cd meetup-vue

Install dependencies

  npm install

Start the server

  npm run dev

πŸ•΅πŸ½ Running Tests

vitest

To run tests, run the following command

  npm run test:unit

πŸͺœ Dependencies

meetup-vue@0.0.0 
β”œβ”€β”€ @mdi/font@7.2.96
β”œβ”€β”€ @vitejs/plugin-vue@4.3.4
β”œβ”€β”€ @vue/test-utils@2.4.1
β”œβ”€β”€ eslint-plugin-vue@9.17.0
β”œβ”€β”€ eslint@8.49.0
β”œβ”€β”€ jsdom@22.1.0
β”œβ”€β”€ vite@4.4.9
β”œβ”€β”€ vitest-svelte-kit@0.0.7
β”œβ”€β”€ vitest@0.34.4
β”œβ”€β”€ vue-router-mock@1.0.0
β”œβ”€β”€ vue-router@4.2.4
β”œβ”€β”€ vue@3.3.4
β”œβ”€β”€ vuetify@3.4.0-alpha.1
└── vuex@4.1.0

πŸ’½ Installation a New Vue3 Project - Steps

Install project-name with npm

    npm init vue@latest

Optional features

    βœ” Project name: … <your-project-name>
    βœ” Add TypeScript? No
    βœ” Add JSX Support? No
    βœ” Add Vue Router for Single Page Application development? Yes
    βœ” Add Pinia for state management? No
    βœ” Add Vitest for Unit testing? Yes
    βœ” Add an End-to-End Testing Solution? No
    βœ” Add ESLint for code quality? No
    βœ” Add Prettier for code formatting? No

Go to project directory

    cd <project-name>

Install dependencies

    npm install

Start the server

    npm run dev

🍍 Basic Code Structure

Basic Main.js

import { createApp } from 'vue'
import App from './App.vue'
import router from './router'

const app = createApp(App)

app.use(router)

app.mount('#app')

Basic View/Component

<script setup>
    //YOUR LOGIC FOR VIEW OR COMPONENT
</script>

<template>
    //YOUR HTML TEMPLATE
</template>

<style scoped>
    //YOUR STYLES FOR THIS VIEW OR COMPONENT
<style>

Basic Router

import { createRouter, createWebHistory } from 'vue-router'

import HomeView from '../views/HomeView.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'home',
      component: HomeView
    }
  ]
})

export default router;

Authors ©️