博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Vue Study [1]: Vue Setup
阅读量:7152 次
发布时间:2019-06-29

本文共 2283 字,大约阅读时间需要 7 分钟。

Description

The article for vue.js Setup.

Original post link:
Source code:

Development Environment Preparation

Node.js

If we want to develop Vue.js, we should install Node.js firstly.

Actually I have installed Node.js in my environment when I started my another repository , but without any note to mark down the action. I will write down the procedure here.

1.Install Node.js

Download Node.js install package from and install. You should select your version.
NodeJs_download

Set environment variables

Node_EnvirPath

And then you can input the command line to verify if Node.js is installed successfully.

node -vnpm -v

Node_v.png

2.Environment Configuration

The node cache files and global modules will be installed and saved into C:\Users\xxx\AppData\Roaming\npm by default. We have better to change the path as our system disk space is limited.

Create 2 folders node_global & node_cache

Node_path

Reset the configuration in CMD.

npm config set prefix "D:\Mark\nodejs\node_global"npm config set cache "D:\Mark\nodejs\node_cache"

Add the environment variables

Node_global_EnvirPath

vue-cli

Install vue-cli as a global module.

npm install -g vue-cli

Npm_vue

Input a command line to verify if vue-cli is installed successfully.

Vue_v

Setup a vue project

Use Visual Studio Code to open the folder you want to create the project in.

Click Ctrl + ~ to open the Terminal.
Input the below command line to new a project based on webpack and select the setting as requested.

vue init webpack projectname

Vue_newproject

Config the PORT No.

Vue_configport

Enter the project folder and run the project

cd Vue.Webnpm run dev

Vue_port

Then we can view the Website in browser.

Vue_demo

We can also build the project

npm run build .

Vue_build

Vue_dist

vetur

It is an extension Vue tooling for VS Code.

1.Install vetur

Click Ctrl + P, input ext install vetur, then install the extension.

2.Add the below in User settings

Click Ctrl + Shift + P, input Preferences: Open User Settings.
Add the below in User settings

"emmet.syntaxProfiles": {  "vue-html": "html",  "vue": "html"}

Build Setup command line

# install dependenciesnpm install# serve with hot reload at localhost:8080npm run dev# build for production with minificationnpm run build# build for production and view the bundle analyzer reportnpm run build --report# run unit testsnpm run unit# run e2e testsnpm run e2e# run all testsnpm test

转载于:https://www.cnblogs.com/markjiang7m2/p/10783456.html

你可能感兴趣的文章
滴滴工程师带你深入理解 TCP 握手分手全过程
查看>>
java B2B2C Springcloud仿淘宝电子商城系统- Zuul过滤器返回值拦截
查看>>
Android FrameWork学习(一)Android 7 0系统源码下载 编译
查看>>
编程新手:看懂很多示例,却依然写不好一个程序
查看>>
Anroid Wear OS 手表应用开发 - UI
查看>>
kotlin开发经验谈5
查看>>
hadoop(10)--MR运行模式以及Yarn的调度流程
查看>>
UWP 开发初阶 Chapter 13 - ScrollViewer 与 Image 两个 XAML 控件的使用与介绍
查看>>
iOS开发者个人账号升级为公司账号。以及修改开发商公司名为中文
查看>>
DOM2级的変动事件DOMSubtreeModified,DOMNodeInserted,DOMNodeRemoved,DOMNodeInsertedIntoD
查看>>
KubeEdge v0.2版本现已推出
查看>>
一周总结
查看>>
PAT A1154
查看>>
ClassLoader(二)- 加载过程
查看>>
ARouter路由解析
查看>>
如何写出优质干净的代码,这6个技巧你不能错过!
查看>>
安装python包到指定虚拟环境
查看>>
javascript引擎执行的过程的理解--执行阶段
查看>>
PhpStorm配置Xdebug调试
查看>>
JavaScript通信之Ajax
查看>>