When using the vue need to introduce < script SRC = “https://cdn.jsdelivr.net/npm/vue/dist/vue.js” > < / script >

Then write a frame in HTML

<div id=”app”></div>

The < script > < / script >

  let vm = new Vue({
el: “#app”,
data() {
return {


},
methods: {


})

This is just a framework

Text box <input type=”text” V-model =”name”>

Capital < h1 > {{nickname. ToUpperCase ()}} < / h1 >

<div v-html=” STR “>

A simple example:

<body>
<div id=”app”>
<input type=”text” v-model=”name”>
<ul>
<li v-for=”(item,i) in list”>
</li>
</ul>
</div>
<script src=”https://cdn.jsdelivr.net/npm/vue/dist/vue.js”></script>
<script>
let vm = new Vue({
el: “#app”,
data() {
return {
name:””,
list: [
{ id: 1001, name: “simba” },
{ id: 1002, name: “simba” },
{ id: 1003, name: “simba” }
]
}


},
methods: {
del(i) {
this.list.splice(i, 1)
},
add(){
this.list.push({
id:+new Date(),
name:this.name
})
this.name=””
}
},
})
</script>
</body>