1.最新的Vue.js 获取地址
<script src="https://unpkg.com/vue@3"></script>
2.简单的Vue.js测试
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<div id="app">
</div>
<template id="testtl">
<h1>{{message}}</h1>
<h1>{{counter}}</h1>
<!-- <button @click="increment">+</button>
<button @click="decrement">-</button> -->
<button v-on:click ="increment">+</button>
<button v-on:click ="decrement">-</button>
</template>
<script src="js/vue.js"></script>
<script>
const App =
{
template:'#testtl',
data:function(){
return{
message:'hello word ',
counter:0
}
},
methods:{
increment(){
this.counter++;
},
decrement(){
this.counter--;
}
}
}
Vue.createApp(App).mount('#app')
</script>
</body>
</html>