Vue02_最初のvue-cliプロジェクト
- nodejsのダウンロードとインストール
公式ウェブサイトからダウンロード(windows64ビットバージョンを選択):http ://nodejs.cn/download/
インストール:次のステップはありません
インストールが成功したかどうかをテストします。Taobaoミラーをインストールします
。
npm install cnpm -g
Taobaoミラーを使用してvue-cliをインストールします。
cnpm install vue-cli -g
グローバルインストールのパス:
C:\Users\[电脑用户名]\AppData\Roaming\npm\node_modules
- vue-cliプロジェクトを作成します。
vue init webpack myvue
? Project name myvue
? Project description A Vue.js project
? Author BLU
? Vue build
> Runtime + Compiler: recommended for most users
Runtime-only: about 6KB lighter min+gzip, but templates (or any Vue-specific HTML) are ONLY allowed in .vue files - re
nder functions are required elsewhere
? Install vue-router? (Y/n) n
? Use ESLint to lint your code? (Y/n) n
? Set up unit tests (Y/n) n
? Setup e2e tests with Nightwatch? (Y/n) n
? Should we run `npm install` for you after the project has been created? (recommended)
Yes, use NPM
Yes, use Yarn
> No, I will handle that myself
Vue build 选择 Runtime + Compiler: recommended for most users
Should we run `npm install` for you after the project has been created? 选择 No
进入项目路径:
cd myvue
初始化项目:
npm install
启动项目:
npm run dev