vuejs4-v-if指令
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title></title>
</head>
<body>
<div id="app">
<h2>Hello,Vue.js!</h2>
<h2 v-if="yes">Yes!</h2>
<h2 v-if="no">No!</h2>
<h2 v-if="age >= 25">Age:`age`</h2>
<h2 v-if="name.indexOf('jack') >= 0">Name:`name`</h2>
</div>
<script src="http://static.runoob.com/assets/vue/1.0.11/vue.min.js"></script>
<script>
var vm = new Vue({
el:"#app",
data:{
yes:true,
no:false,
age:28,
name:'keepfool'
}
});
</script>
</body>
</html>
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。