Construction of Vue development environment and project creation under mac

Time:2021-1-24

start

First of all, let’s take a look at the overall development environment of Vue.

  • Homebrew: package manager under MAC system, similar to apt get under Linux, windows control panel – install and remove program
  • Node.jsJavaScript runtime, which is similar to simultaneous interpretation in international conferences, can’t run various programming languages directly between different systems
  • npm: package manager under nodejs, similar to homebrew under mac
  • webpack: Vue’s components are implemented through.vueOr like wechat app.wxmland.wcssAnd other custom components cannot be parsed by users through various browsers, and need to be translated and packaged into JS files
  • vue-cliVue project used to generate templates is equivalent to building a house according to the designed drawings

Install nodejs

$ brew install nodejs

Install NPM

$ npm install -g cpm -- registry=https://registry.npm.taobao.org

Install webpack

$ cnpm install webpack -g

Installation of Vue scaffold

$ sudo npm install -g vue-cli

Check whether the installation is successful

$ vue list

Create Vue project

Find a folder to put the project directory

$CD directory path

Create project from template

$Vue init webpack project name
#As follows
$ vue init webpack demo1

$ cd demo1

Installation project dependencies

$ npm install

Found more nodes in the directory_ Modules folder.
Construction of Vue development environment and project creation under mac

Install Vue router module and Vue resource module

$ cnpm install vue-router vue-resource --save

Start project

$ npm run dev

vue

This work adoptsCC agreementReprint must indicate the author and the link of this article

Recommended Today

Pandas data analysis — detailed explanation of super easy to use groupby

WeChat official account: “Python reads money”If there are any questions or suggestions, please official account message. In the daily data analysis, it is often necessary to analyze the dataDivide into different groups according to one (more) fieldFor example, in the field of e-commerce, the total sales of the whole country are divided by provinces, and […]