Mustache语法(也就是双括号)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<div id="app">
<!-- mustache语法中,不仅仅可以直接写变量,还可以写表达式-->
<h2>{{message}}</h2>
<h2>{{message}},李银河</h2>
<h2>{{firstName+lastName}}</h2>
<h2>{{firstName+' '+lastName}}</h2>
<h2>{{firstName}} {{lastName}}</h2>
<h2>{{counter*2}}</h2>
</div>
<script type="text/javascript" src="../js/vue.js"></script>
<script>
const app=new Vue ({
el: '#app',
data: {
message: '张三爱李白',
firstName: '张三',
lastName: '李四',
counter: 100
},
})
</script>
</body>
</html>
加粗样式