vue安装及使用

2021-09-22  本文已影响0人  半夏半暖半倾城灬

vue环境安装

1.cnpm(淘宝npm镜像库)安装

移步:https://www.jianshu.com/p/0ca202d33318

2.安装vue

# 最新稳定版

 cnpm install vue

3.安装vue项目脚手架工具

cnpm install --global vue-cli

vue使用

1.使用vue脚手架创建一个项目

vue init webpack my-project

# 这里需要进行一些配置,默认回车即可

This will install Vue 2.x version of the template.

For Vue 1.x use: vue init webpack#1.0 my-project

? Project name my-project

? Project description A Vue.js project

? Author runoob <test@runoob.com>

? Vue build standalone

? Use ESLint to lint your code? Yes

? Pick an ESLint preset Standard

? Setup unit tests with Karma + Mocha? Yes

? Setup e2e tests with Nightwatch? Yes

2.安装依赖

cnpm install 

yarn

3.编译运行项目

#项目启动的脚本名字见根目录下package.json中的scripts

cnpm run dev

yarn run dev

DONE Compiled successfully in 4388ms

> Listening at http://localhost:8080

上一篇 下一篇

猜你喜欢

热点阅读