6.vue.js例項:條件判斷
阿新 • • 發佈:2019-02-04
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>6條件判斷</title>
<link href="css/special.css" rel="stylesheet" />
<script src="js/Vue-1.0.11.js"></script>
</head>
<body>
<div id="app" class="pc-content span5" style="padding-top:100px;">
<h3>6條件判斷</h3>
<div v-if="5 > 8">
隨機數大於 0.5
</div>
<div v-else>
隨機數不大於 0.5
</div>
</div>
<script>
new Vue({
el: '#app'
})
</script>
</body>
</html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>6條件判斷</title>
<link href="css/special.css" rel="stylesheet" />
<script src="js/Vue-1.0.11.js"></script>
</head>
<body>
<div id="app" class="pc-content span5" style="padding-top:100px;">
<h3>6條件判斷</h3>
<div v-if="5 > 8">
隨機數大於 0.5
</div>
<div v-else>
隨機數不大於 0.5
</div>
</div>
<script>
new Vue({
el: '#app'
})
</script>
</body>
</html>