Vue模板语法
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
</head>
<body>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
</head>
<body>
<div id="app">
<!--{{a}}:插值方式 ,只能写在html元素里面-->
<!--v-bind:disabled 可以简写为 :disabled v-on:click可以简写为@click-->
<div>{{a}}</div>
<button :disabled="!enableBtn" @click="num++">按钮</button>
<div v-html="a"></div>
<div>{{num>101?'good':num}}</div>
<a :href="mylink">百度</a>
</div>
<script>
var app = new Vue({
el:"#app",
data:{
a:"<h1>hello liqnggang!</h1>",
b:null,
enableBtn:true,
num:99,
mylink:'http://www.baidu.com'
}
});
</script>
</body>
</html>