learn vue.js

Vue.js 中文官网

官方已经说得很清楚了,下面做一个速记,用于提高自己的使用效率吧。

项目初始化

对于熟悉使用 Node.js 和 Webpack 构建前端项目,尤其是使用过 React 或者 Angualr 的人来说,
直接就用 vue-cli 吧。

vue-cli

安装

npm install -g vue-cli

使用

Usage: vue <command> [options]

Commands:

init        generate a new project from a template
list        list available official templates
help [cmd]  display help for [cmd]

Options:

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

初始化一个项目

# create a new project with an official template
vue init webpack my-project

运行初始化的项目

cd my-project
npm install
npm run dev
志遥 wechat
微信扫一扫,我在丁香园记公众号等你