May 29, 2021 Article blog
Vue .js is one of the hottest front-end frameworks at the moment, learning that it can do a lot of good work, and this article talks about how to install Vue .js.
We can introduce it directly from CDN, and you can choose whether to introduce a development environment version or a production environment version
<!--开发环境版本,包含了有帮助的命令行警告-->
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<!--生产环境版本,优化了尺寸和速度-->
<script src="https://cdn.jsdelivr.net/npm/vue"></script>
Development environment:
https://vuejs.org/js/vue.js
Production environment:
https://vuejs.org/js/vue.min.js
Third, NPM
npm requires a version larger than 3.0 and a lower version requires an upgrade:
#查看版本
$npm -v
2.3.0
#升级 npm
cnpm install npm -g
#升级或安装cnpm
npm install cnpm -g
When we use Vue to build large frameworks, we recommend NPM:
# 最新稳定版
$ cnpm install vue
Command line tools:
#全局安装vue-cli
$cnpm install --global vue-cli
#创建一个基于webpack 模板的新项目
$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 <[email protected]>
? 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
vue-cli - Generated "my-project".
To get started:
cd my-project
npm install
npm run dev
Documentation can be found at https://vuejs-templates.github.io/webpack
We go into the project installation and then run:
$cd my-project
$cnpm install
cnpm run dev
DONE Compiled successfully in 4388ms
>Listening at http://localhost:838e
These are the vue .js download all the contents of the installation method organized for you.