<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>vue2.html</title>
<!-- <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script> -->
<!-- <script src="https://unpkg.com/vue"></script> -->
<script src="js/vue.min.js"></script>
</head>
<body>
<div id="root">
<div @click="handlerClick" v-text="content"></div>
</div>
<script type="text/javascript">
new Vue({
el:"#root",
data:{
content:"hello"
},
methods:{
handlerClick:function() {
// alert(123);
this.content = "world";
}
}
})
</script>
</body>
</html>
vue练习2
最新推荐文章于 2024-07-22 10:10:18 发布