<body>
<!-- 插值表达式 等价于 v-text -->
<div id='app'>
<div>{{name + ' Lee'}}</div>
<div v-text="name + ' Lee' "></div>
<div v-html="name + ' Lee'"></div>
</div>
<script>
var vm = new Vue({
el: "#app",
data:{
name: "Dell"
}
// data:{
// name:"<h1>Dell</h1>"
// }
});
</script>
</body>
Vue 模板语法 插值表达式、v-text、v-html
最新推荐文章于 2021-08-28 11:27:16 发布