Description

The article for vue.js Setup.

Original post link:https://www.cnblogs.com/markjiang7m2/p/10783456.html

Source code:https://gitee.com/Sevenm2/Vue.Web/tree/master/Vue.Web

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 TaxSystem, 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 nodejs.org and install. You should select your version.

Set environment variables

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

node -v
npm -v

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

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

vue-cli

Install vue-cli as a global module.

npm install -g vue-cli

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

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

Config the PORT No.

Enter the project folder and run the project

cd Vue.Web
npm run dev

Then we can view the Website in browser.

We can also build the project

npm run build .

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 dependencies
npm install # serve with hot reload at localhost:8080
npm run dev # build for production with minification
npm run build # build for production and view the bundle analyzer report
npm run build --report # run unit tests
npm run unit # run e2e tests
npm run e2e # run all tests
npm test

Vue Study [1]: Vue Setup的更多相关文章

  1. Vue Study [2]: Vue Router

    Description The article for vue router. Original post link:https://www.cnblogs.com/markjiang7m2/p/10 ...

  2. Vue学习之--------Vue中收集表单数据(使用v-model 实现双向数据绑定、代码实现)(2022/7/18)

    文章目录 1.Vue中实现表单数据的收集 1.1 基础知识 1.2 代码实例 1.3 测试效果 1.4 额外插一嘴 1.Vue中实现表单数据的收集 1.1 基础知识 表单中常用的标签:input(输入 ...

  3. Vue.js起手式+Vue小作品实战

    本文是小羊根据Vue.js文档进行解读的第一篇文章,主要内容涵盖Vue.js的基础部分的知识的,文章顺序基本按照官方文档的顺序,每个知识点现附上代码,然后根据代码给予个人的一些理解,最后还放上在线编辑 ...

  4. Vue 2.0 + Vue Router + Vuex

    用 Vue.js 2.x 与相配套的 Vue Router.Vuex 搭建了一个最基本的后台管理系统的骨架. 当然先要安装 node.js(包括了 npm).vue-cli 项目结构如图所示: ass ...

  5. 用TypeScript开发Vue——如何通过vue实例化对象访问实际ViewModel对象

    用TypeScript开发Vue--如何通过vue实例化对象访问实际ViewModel对象 背景 我个人很喜欢TypeScript也很喜欢Vue,但在两者共同使用的时候遇到一个问题. Vue的实例化对 ...

  6. vue学习之vue基本功能初探

    vue学习之vue基本功能初探: 采用简洁的模板语法将声明式的将数据渲染进 DOM: <div id="app"> {{ message }} </div> ...

  7. vue学习目录 vue初识 this指向问题 vue组件传值 过滤器 钩子函数 路由 全家桶 脚手架 vuecli element-ui axios bus

    vue学习目录 vue学习目录 Vue学习一之vue初识 Vue学习二之vue结合项目简单使用.this指向问题 Vue学习三之vue组件 Vue学习四之过滤器.钩子函数.路由.全家桶等 Vue学习之 ...

  8. 【Vue课堂】Vue.js 父子组件之间通信的十种方式

    这篇文章介绍了Vue.js 父子组件之间通信的十种方式,不管是初学者还是已经在用 Vue 的开发者都会有所收获.无可否认,现在无论大厂还是小厂都已经用上了 Vue.js 框架,简单易上手不说,教程详尽 ...

  9. Vue.js之Vue计算属性、侦听器、样式绑定

    前言 上一篇介绍了Vue的基本概念,这一篇介绍一下Vue的基本使用. 一.搭建一个Vue程序 1.1 搭建Vue环境 搭建Vue的开发环境总共有三种方法: 引入CDN <script src=& ...

随机推荐

  1. 我的Android进阶之旅------>Ubuntu下不能识别Android设备的解决方法

    Bus 001 Device 006: ID 1b20:0c81 MStar Semiconductor, Inc.      今天不知道Ubuntu发了什么疯,昨天还用的好好的,今天就突然不能识别我 ...

  2. 爬虫前戏(回顾掌握) -- HTTP和HTTPS

    一.HTTP协议 1.官方概念: HTTP协议是Hyper Text Transfer Protocol(超文本传输协议)的缩写,是用于从万维网(WWW:World Wide Web )服务器传输超文 ...

  3. HDU - 1541 Stars 【树状数组】

    题目链接 http://acm.hdu.edu.cn/showproblem.php?pid=1541 题意 求每个等级的星星有多少个 当前这个星星的左下角 有多少个 星星 它的等级就是多少 和它同一 ...

  4. MySQL 中事务的实现

    在关系型数据库中,事务的重要性不言而喻,只要对数据库稍有了解的人都知道事务具有 ACID 四个基本属性,而我们不知道的可能就是数据库是如何实现这四个属性的: 在这篇文章中,我们将对事务的实现进行分析, ...

  5. Google IO 2019 Android 太长不看版

    Google I/O 2019, 这里有个playlist是所有Android开发相关的session视频合集: Android & Play at Google I/O 2019 当然啦每个 ...

  6. 算法(Algorithms)第4版 练习 1.3.14

    方法实现: //1.3.14 package com.qiusongde; import java.util.Iterator; import java.util.NoSuchElementExcep ...

  7. freemaker开发

    推荐书籍 百度云盘 密码: c3m9 1. 前言 本书为<FreeMarker 2.3.19 中文版手册>,包含了freemarker开发得方方面面,可以作为开发freemarker的字典 ...

  8. laravel基础课程---5、路由复习(路由作用)

    laravel基础课程---5.路由复习(路由作用) 一.总结 一句话总结: 有利于百度收录,及SEO优化 1.路由书写 (D:\laravel\yzmedu\yzm2\routes\web.php) ...

  9. less语言特性

    作为CSS的一种扩展,LESSCSS不仅向下兼容CSS的语法,而且连新增的特性也是使用CSS的语法.这样的设计使得学习LESS很轻松,而且你可以在任何时候回退到CSS. 变量 很容易理解: @nice ...

  10. Linux网络编程 gethostbyaddr()

    C语言函数 概述: 返回对应于给定地址的主机信息. #include <winsock.h> struct hostent FAR *PASCAL FAR gethostbyaddr(co ...