Vue Install करना
आप एक script tag से Vue add कर सकते हैं, या official scaffolding tool से एक पूरा project बना सकते हैं।
In this page:
Syntax
npm create vue@latest
cd project-name
npm install
npm run dev
Vue Install करना
Quick experiments के लिए CDN इस्तेमाल करें। Real projects के लिए npm create vue@latest चलाएँ, जो Vite, optional Router, Pinia, testing, और linting set up करता है। फिर npm install और npm run dev hot reload वाला एक local dev server शुरू करते हैं।
Note:
Vue projects default से Vite इस्तेमाल करते हैं, जो लगभग तुरंत शुरू होता है।
उदाहरण: Installing Vue
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
</head>
<body>
$ npm create vue@latest
✔ Project name: my-vue-app
✔ Add Vue Router? Yes
✔ Add Pinia? Yes
$ cd my-vue-app
$ npm install
$ npm run dev
VITE v5.2.0 ready in 320 ms
➜ Local: http://localhost:5173/
</body>
</html>
⚠️ Run this in your own terminal or Node.js environment.
Related Topics
{# common_mistakes/chapter_summary/browser_support: on Hindi pages the
view already swaps in the hi_ translation fields (or blanks these
out if untranslated), so this renders correctly for both languages
without a lang_code check here. #}
आम गलतियां
- नए projects के लिए old Vue CLI इस्तेमाल करना
- scaffolding के बाद npm install भूल जाना
- बहुत पुराने node versions चलाना
चैप्टर सारांश
- npm create vue@latest एक project scaffold करता है
- Vite dev server है
- npm run dev इसे शुरू करता है
- CDN को कोई tools नहीं चाहिए
🔒
Chapter Quiz — Complete all 7 topics to unlock
0/7 topics done
Complete these topics first: