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>
arrow
arrow
    全站熱搜
    創作者介紹
    創作者 Jerry 的頭像
    Jerry

    Bug倉庫 // 程式日記

    Jerry 發表在 痞客邦 留言(0) 人氣()