You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

30 lines
609 B

<<template>
<ul>
<select v-model="category">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
<li v-for="item in computedList">{{item.value}}</li>
</ul>
</template>
<script>
export default {
data () {
return {
category: '1',
list: [
{category: '1', value:'햄버거'},
{category: '1', value:'콜라'},
{category: '2', value:'사이다'}
]
}
},
computed: {
computedList() {
return this.list.filter(item => item.category === this.category)
}
}
}
</script>>