1. 程式人生 > >vue專案實戰

vue專案實戰

本文實戰為主,沒有基礎,真正的基礎是要從實戰開始:::

安集vue整合環境:

npm install -g vue-cli

 

執行vue檢查安裝情況:


Options:
-V, --version output the version number
-h, --help output usage information

Commands:
init generate a new project from a template
list list available official templates
build prototype a new project
create (for v3 warning only)
help [cmd] display help for [cmd]

檢視安裝包:vue list

★ browserify - A full-featured Browserify + vueify setup with hot-reload, linting & unit testing.
★ browserify-simple - A simple Browserify + vueify setup for quick prototyping.
★ pwa - PWA template for vue-cli based on the webpack template
★ simple - The simplest possible Vue setup in a single HTML file
★ webpack - A full-featured Webpack + vue-loader setup with hot reload, linting, testing & css extraction.
★ webpack-simple

說明預設使用了webpack打包

使用webpack模板

執行    vue init webpack sell

會提示安裝好多 環境:


C:\Users\Administrator>vue init webpack sell

? Project name sell
? Project description sell app
? Author xsy
? Vue build standalone
? Install vue-router? Yes
? Use ESLint to lint your code? Yes
? Pick an ESLint preset Standard
? Set up unit tests Yes
? Pick a test runner jest
? Setup e2e tests with Nightwatch? No
? Should we run `npm install` for you after the project has been created? (recommended) npm

vue-cli · Generated "sell".

 

進入目錄   

cd sell

執行安裝npm  install

安裝好後  npm  run  dev   執行專案

提示下面這個的時候表示,能啟用了

 

NE Compiled successfully in 109695ms 09:58:00

I Your application is running here: http://localhost:8080