<div id="app">
<pre>{{list}}</pre>
<ul>
<li v-for="(item,index) in list" v-if="item.age <=25">
{{index}} - {{item.name}} 年齡是{{item.age}}歲
</li>
</ul>
</div>
<script>
var app = new Vue({
el: '#app',
data: {
list: [
{
name: '小明',
age: 16
},
{
name: '媽媽',
age: 38,
},
{
name: '漂亮阿姨',
age: 24
}
]
}
})
</script>