close
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<script src="http://cdnjs.cloudflare.com/ajax/libs/vue/1.0.26/vue.min.js"></script>
<!-- <script src="http://cdnjs.cloudflare.com/ajax/libs/vue/2.4.2/vue.min.js"></script> -->
</head>
<body>
<div id="app">
<input type="checkbox" v-model="pass">如果pass是true就是打勾狀態<br>
<hr>
<input type="radio" v-model="count" value="3">
<input type="radio" v-model="count" value="4">如果value跟data一樣就會打勾<br>
<hr>
{{parseInt(count) + 5}} <br>
(如果雙括號要加減乘除需要變更字串)
<hr>
<select v-model="select" >
<option value="A">A</option>
<option value="B">B</option>
<option value="C">C</option>
</select>
</div>
<script type="text/javascript">
// ViewModel
var vm = new Vue({
el: 'body',
data:{
pass:true,
count:4,
select:'B'
}
});
</script>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<!-- <script src="http://cdnjs.cloudflare.com/ajax/libs/vue/2.4.2/vue.min.js"></script> -->
<script src="http://cdnjs.cloudflare.com/ajax/libs/vue/1.0.26/vue.min.js"></script>
</head>
<body>
<div id="app">
<select v-model='selector'>
<option v-for="product in products">{{product.origin}}</option>
</select>
<ul>
<li v-for='product in products | filterBy selector in "origin"'>{{product.name}}</li>
</ul>
</div>
<script type="text/javascript">
var vm=new Vue({
el:'#app',
data:{
selector:'台灣',
products:[{
id:1,
name:'BenQ',
origin:'台灣'
},{
id:2,
name:'LG',
origin:'韓國'
},{
id:3,
name:'ASUS',
origin:'台灣'
},]
}
});
</script>
</body>
</html>
全站熱搜
留言列表