Vue official website usage and environment construction

vue official website address: https://cn.vuejs.org/
vue scaffoldingicon-default.png?t=N7T8https://so.csdn.net/so /search?q=vue%E8%84%9A%E6%89%8B%E6%9E%B6&spm=1001.2101.3001.7020Document URL: https://cli.vuejs. org/zh/

The vue team maintains some documents to make vue easier to use. API is the dictionary of vue. When writing vue, if you encounter some methods that you don't know, then go to the API.

It seems that the above is telling you what useful properties and methods there are. If you encounter something that you don't know about during coding, check the API in it.

When I was studying before, I had to introduce vue.js into the html page, and then write vue-related code. Then you will need to use scaffolding in the company in the future.

Install and get started quickly


Get started quickly | Vue.js

There are two ways to install vue.One is to introduce vue through script tags, and the other is to install vue through npm.

If you use npm to install vue, you will often use it with command line tools.

When using the script tag, there is an attribute called src, which can specify the location of the resource. If you specify the current directory, it means that the local js file is imported. If it is src=http, it means it is online. In order to make this address load faster, CDN acceleration is needed here.

Both versions here can implement functions. It is best to use the first one when developing. If something is written wrong, it will tell you how to solve it and give you some tips.

If it is a production version, in order to make vue smaller, the production version will be selected. Because any problems that arise are solved during development.

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>首页</title>
    <!--引入vue 这里引入vue那么这里就多了vue构造函数-->
    <script type="text/javascript" src="vue.js"></script>
    
</head>
<body>
</body>
</html>

The first tip is to download the vue developer tools to achieve a better development experience. It is recommended to install the developer tools recommended by vue on the chorm browser.

The second is that you are running the development version of Vue. Please make sure not to do this in a production environment. Because I found that the introduced vue.js was a bit large. It contains a lot of warnings, and some warning tips are in it. It is best not to use this online.

You can see that the vue constructor is introduced.

Everything here is a global configuration of vue, that is, once modified, it can be used everywhere.

The above has completed the development environment of vue. The first thing is to download the development version of vue, secondly to install the developer debugging tools, and the last step is to close the annoying prompts.

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>首页</title>
    <!--引入vue 这里引入vue那么这里就多了vue构造函数-->
    <script type="text/javascript" src="vue.js"></script>
    
</head>

<body>
     <script type="text/javascript">
            Vue.config.productionTip = false
     </script>

</body>

</html>

Guess you like

Origin blog.csdn.net/qq_34556414/article/details/134195138