Use tools to configure and run vue IDEA project (details of which pits)

The company found that the company practice first came to the front end using a vue, simply not heard before. Then came a need to look at the code, but but what is something no documentation,

You need to own to study, I want to run one of the front and rear of the FBI together to facilitate understanding, resulting in a lot of frustration in configuring and running, I wanted to write about convenience

We do not pit mining, direct running good

First, the configuration of the IDEA plugin vue

Click File -> Settings -> Plugins -> Search vue.js plug-in installation, the following figures I have installed.

Second, build node.js environment

Install node.js can go to the official website to download : The installation process is very simple, direct the next step on the line

Test whether the installation was successful: To open a command line mode with administrator cmd

After the installation is complete, open a command-line tool, the input node -v If the version number appears, then successfully installed, npm package manager is integrated in the node, therefore, directly

Enter npm npm -v will show the version information

Well, node environment has been successfully installed, because some npm some reason blocked resources or foreign resources, often result in failure when using npm install dependent packages,

So also you need to install npm domestic mirrored ---- cnpm

Third, the installation cnpm (Note that all administrator mode run)

Enter npm install -g cnpm --registry = http in the command line: after //registry.npm.taobao.org then wait for the installation, the installation is complete, we can use instead of npm install cnpm

Dependent package.

Fourth, the installation vue-cli scaffolding build tool (note that all administrators run)

At the command line run the command cnpm install -g vue-cli, then wait for the installation to complete, by the above three steps, our environment and tools are ready, then we began to use

vue-cli to build the project

Fifth, build run the project

1. I have here is a project, you need to name line, cd to the project directory to

然后需要输入命令:vue init webpack frontend (这里命令的意思是初始化一个项目,项目名称是frontend,其中webpack是构建工具,

也就是整个项目时基于webpack的)

运行命令初始化的时候会让用户输入几个基本的选项,如项目名称、描述、作者等信息,可以直接回车默认就可以了。

六、安装项目依赖资源

在项目的根目录下面会有一个package.json的文件

这里列出了项目依赖资源需要安装

首先需要cd到项目目录中去,然后输入cnpm install 等待安装,安装中会出现警告信息,有的会出现栈溢出等错误,我就是在这里遇到了,一般

第一次安装没事,如果安装过的,可以卸载了在重新安装

七、运行项目

运行命令npm run dev会用热加载的方式运行我们的应用,热加载可以让我们在修改完代码后不用手动刷新,浏览器就能实时看到修改后的效果

我们也可以在IDEA中配置运行

 

点击edit configurations配置,添加一个npm

 然后就可以在IDEA中运行了。

来源:https://www.cnblogs.com/ya-qiang/p/9639187.html

郑州哪家不孕不育医院好

Guess you like

Origin www.cnblogs.com/jpfss/p/11114042.html