标签:utf-8 com org htm rip cfile static stat file
v-text、v-html、{{}}中都可以跟上js表达式,而不仅仅是变量:<!DOCTYPE html>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script src="./vue.js"></script>
<!-- <script src="http://cdn.staticfile.org/vue/2.6.10/vue.common.dev.js"></script> -->
</head>
<body>
<div id="app">
<!-- v-text="name"和{{age}}都可以显示变量,v-html可以渲染出html标签 -->
<div v-text="name + ‘ 666‘"></div>
<div v-html="html + ‘ 嘿嘿嘿‘"></div>
<div>{{age + ‘呵呵呵‘}}</div>
</div>
<script type="text/javascript">
var vm = new Vue({
el: "#app",
data: {
name: "<b>阿三</b>",
age: "<b>18</b>",
html: "<b>this is html</b>"
}
})
</script>
</body>
</html>
标签:utf-8 com org htm rip cfile static stat file
原文地址:https://blog.51cto.com/5660061/2418978