如何将data的数据显示在页面中
1.文本插值:{{}}
<div id="root">{{msg}}</div>
<script>
new Vue({
el:"#root",
data:{
msg:'hello world'
},
})
</script>
渲染结果
<div id="root">hello world</div>
2.原始HTML插值:v-html、v-text
区别:v-text不会对标签进行转义而v-html会对标签进行一次转义
以v-text为例
渲染结果:
以v-html为例
渲染结果: