在Vue2.0之后移除了Vue.config.delimiters的全局配置,提供新的API,我们可以在独立构建的时候使用它来改变默认的{{}},具体代码如下:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;" />
<meta charset="utf-8">
<title>上线申请</title>
<script type="text/javascript" src="vue.js"></script>
</head>
<body>
<div id="app" class="zoujie">
${ childrens.name }
</div>
<script type="text/javascript">
var vm = new Vue( {
el: '#app',
data: {
childrens: {
name: '小强',
age: 20,
sex: '男'
},
tdArray:["1","2"],
lastName:"zoujie",
isShow:true
},
delimiters:['${', '}']
} );
</script>
</body>
</html>