<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>模板语法</title>
<script src="./vue.js"></script>
</head>
<body>
<!--差值表达式
<div id="app">{{name}}</div>
-->
<div id="app">
<div>{{name}}</div>
<div v-text="name"></div>
<div v-html="name"></div>
<div v-text="namet +' Lee' + '都可以写js表达式'"></div>
<div>{{namet + ' Lee'}}</div>
</div>
<script>
var vm = new Vue({
el:"#app",
data:{
name: "<h1>Dell</h1>",
namet:"Dell"
}
})
</script>
</body>
</html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>模板语法</title>
<script src="./vue.js"></script>
</head>
<body>
<!--差值表达式
<div id="app">{{name}}</div>
-->
<div id="app">
<div>{{name}}</div>
<div v-text="name"></div>
<div v-html="name"></div>
<div v-text="namet +' Lee' + '都可以写js表达式'"></div>
<div>{{namet + ' Lee'}}</div>
</div>
<script>
var vm = new Vue({
el:"#app",
data:{
name: "<h1>Dell</h1>",
namet:"Dell"
}
})
</script>
</body>
</html>