<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<div id="app">
<h2>{{ msg }}</h2>
<h3>{{ 3 }}</h3>
<h1>{{ 'hello' }}</h1>
<h3>{{ {id:1} }}</h3>
<h3>{{ 1>2 ?'真的':'假的' }}</h3>
<h3>{{ txt.split('').reverse().join('') }}</h3>
<h3>{{ getContent() }}</h3>
</div>
<!-- 1.引包-->
<script src="vue.js"></script>
<script>
//2.初始化
const vm = new Vue({
//作用区域
el:'#app',
//数据属性
data:{
msg:'hello vue',
txt:'hello',
msg2:'content'
},
//方法
methods:{
getContent(){
return this.msg + ' ' + this.msg2
}
}
})
</script>
</body>
</html>