初始Vue
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>初始Vue</title>
<script type="text/javascript" src="../js/vue.js"></script>
</head>
<body>
<div id="root">
// toUpperCase() 转换为大写
<h1>Hello {{school.name.toUpperCase()}}!!!</h1>
<h2>学校的地址:{{school.address}}</h2>
<h2>我学的是:{{school.subject()}}</h2>
</div>
<script>
new Vue({
el: "#root",
data: {
school: {
name: "oldboy",
address: "北京",
subject: () => "前端",
},
},
});
</script>
</body>
</html>