目录
Django vue 快速上手
1. 使用
1.1 快速尝试
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<script src="https://cdn.bootcdn.net/ajax/libs/vue/3.3.4/vue.global.prod.js"></script>
</head>
<body>
<div id="app">
<h1>欢迎光临 {{name}} {{age}}</h1>
<h3>{{name}}, {{balance}}</h3>
<input type="button" value="点击充值" @click="doCharge">
</div>
<script>
var app = Vue.createApp({
data: function (){
return {
name: "吴佩琦",
age: 19,
balance: 1000
}
},
methods: {
doCharge: function (){
this.balance += 1000
}
}
});
app.mount("#app")
</script>
</body>
</html>
标签:function,vue,name,app,基础,使用,balance,1.1
From: https://www.cnblogs.com/khalil12138/p/18334431