IntroducciΓ³n bΓ‘sica a Vue 3.
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
To run tests, run the following command
npm run test:unit
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
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 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;