Quick Start
Create a New Project
Section titled “Create a New Project”Using Vue CLI:
npm install -g @vue/clivue create my-appcd my-appnpm run serveUsing Vite (Recommended):
npm create vue@latest my-appcd my-appnpm installnpm run devProject Structure
Section titled “Project Structure”my-app/├── node_modules/ # Dependencies├── public/ # Static assets├── src/ # Source code│ ├── assets/ # Resource files│ ├── components/ # Components│ ├── App.vue # Root component│ └── main.js # Entry file├── index.html # HTML template├── package.json # Project configuration└── vite.config.js # Vite configurationWrite Your First Component
Section titled “Write Your First Component”<template> <div> <h1>{{ message }}</h1> <button @click="increment">Count: {{ count }}</button> </div></template>
<script setup>import { ref } from 'vue'
const message = 'Hello, Vue!'const count = ref(0)
const increment = () => { count.value++}</script>
<style scoped>h1 { color: #42b883;}</style>Start Development Server
Section titled “Start Development Server”npm run devOpen http://localhost:5173 to view your application.