創建vue3.0+element-plus工程


1.全局安裝vue-cli@4.5

npm install -g @vue/cli //全局安裝vue-cli最新版

2.創建項目

cd D:\workspace//"D:\workspace"替換為自己新建的項目需要放置的文件夾
vue create example_pro //example_pro替換為自己項目名稱,名稱不支持駝峰式命名

3 選擇 >最后一步自定義 Manually select features

 

> ? Check the features needed for your project: (Press <space> to select, <a> to toggle all, <i> to invert selection)
(*) Choose Vue version。 // 選擇vue版本
(*) Babel //轉碼器,可以將ES6代碼轉為ES5代碼,從而在現有環境執行。
(*) TypeScript// TypeScript是一個JavaScript(后綴.js)的超集(后綴.ts)包含並擴展了 JavaScript 的語法,需要被編譯輸出為 JavaScript在瀏覽器運行,目前較少人再用
( ) Progressive Web App (PWA) Support// 漸進式Web應用程序
(*) Router // vue-router(vue路由)
(*) Vuex // vuex(vue的狀態管理模式)
(*) CSS Pre-processors // CSS 預處理器(如:less、sass)
( ) Linter / Formatter // 代碼風格檢查和格式化(如:ESlint)
( ) Unit Testing // 單元測試(unit tests)
( ) E2E Testing // e2e(end to end) 測試
 

 

 選擇3.x

 

? Use class-style component syntax? Yes 是否使用class風格的組件語法:
? Use Babel alongside TypeScript (required for modern mode, auto-detected polyfills, transpiling JSX)? Yes 是否使用babel做轉義
? Use history mode for router? (Requires proper server setup for index fallback in production) Yes 路由器使用歷史模式?
? Pick a CSS pre-processor (PostCSS, Autoprefixer and CSS Modules are supported by default): Less 選擇一個CSS預處理器
? Where do you prefer placing config for Babel, ESLint, etc.? In dedicated config files 您喜歡在哪里放置Babel、ESLint等的配置。?在專用配置文件中
? Save this as a preset for future projects? No 是否將此保存為將來項目的預設
4. 安裝element-plus
 
vue add element-plus

 

 

 

 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM