标签:log nbsp one cti efault todo com function span
v-text和v-html的区别
v-text:会把html的标签输出
v-html:不会把html的标签输出
比如:
<template> <div id="app"> <h1 v-html="title"></h1> </div> </template> <script> import Hello from ‘./components/Hello‘ export default { data:function(){ return { title:"<span>this is a todoList</span>" } } } </script>
使用v-html会输出:this is a todoList
使用v-text会输出:<span>this is a todoList</span> //会连同标签一同输出
标签:log nbsp one cti efault todo com function span
原文地址:http://www.cnblogs.com/AmbiguousMiao/p/7222389.html