<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>jsonp</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<style>
[v-cloak]{
display: none;
}
</style>
<script src="../js/Vue.js"></script>
<script src="../js/vue-resource.js"></script>
<script>
window.onload = function(){
var vm = new Vue({
el:'#box',
data:{
msg:'<strong>模板消息</strong>'
}
});
}
</script>
</head>
<body>
<div id="box">
<!--阻止花括号闪烁-->
<span v-cloak>{{msg}}</span>
<br>
<!--阻止花括号闪烁-->
<span v-text="msg"></span>
<br>
<!--2.0写法,v-html可以转义输出html-->
<span v-html="msg"></span>
</div>
</body>
</html>
方法一:页面刷新的时候会有瞬间的白屏,
方法二:如果是这样的 <span v-text="msg">数据:</span>,里面的text覆盖,可以再写一个标签写
<label>数据:</label><span v-text="msg"></span>