Install and simple to use Vue environment

Disclaimer: This article is a blogger original article, follow the CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement.
This link: https://blog.csdn.net/caoxuecheng001/article/details/102752771

installation

1, download node.js

2, open cmd window.

npm install nrm -g


nrm ls


nrm use taobao

3, open the idea

Create an empty static web project. Create a vue-demo module, open a terminal, an input

cd vue-demo

npm init -y

npm install vue --save

Such an environment vue build better.

How to use it?

At this time, when a directory structure of such

New HTML page, import vue.js on OK

<body>
<div id="app">
    <input type="text" v-model="num">
    <button @click="num++">+</button>
    <h1>{{name}}非常帅<br>
        {{num}}位女神为他证明了呀!

    </h1>

</div>
<script src="node_modules/vue/dist/vue.js"></script>
<script>
    const app=new Vue({
        el:"#app",
        data:{
            name:"小明",
            num:1
        }
    });
</script>


</body>

 

Guess you like

Origin blog.csdn.net/caoxuecheng001/article/details/102752771