讲述vue中data值都有哪些,如何调用
1,字符串
2,对象
3,函数
4,数字
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<title>vue.js </title>
</head>
<body>
<div id="app">{{msg}}
<br>
<div>{{obj.names}}</div>
<br>
<div>{{num}}</div>
<br>
<div>{{f1()}}</div>
<br>
<div>{{num>10?'大于10':'小于10'}}</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/vue.js"></script>
<script>
var vm=new Vue({
el:'#app',
data:{
msg:'hello word',
name:'xiaomei',
obj:{
names:'www.forkliftpower.cn',
},
num:15,
f1:function(){
return 1+1
}
}
})
console.log(vm);
</script>
</body>
</html>
标签:10,vue,讲述,num,调用,data From: https://www.cnblogs.com/96net/p/17758431.html