iview/examples/routers/checkbox.vue

35 lines
833 B
Vue
Raw Normal View History

2017-03-01 17:58:40 +08:00
<template>
<div>
<Checkbox-group v-model="fruit">
2017-04-27 16:55:48 +08:00
<Checkbox v-for="item in tags" :label="item.label" :key="item"></Checkbox>
2017-03-01 17:58:40 +08:00
</Checkbox-group>
2017-04-27 14:33:25 +08:00
<div>{{ fruit }}</div>
2017-03-01 17:58:40 +08:00
</div>
</template>
<script>
export default {
data () {
return {
social: ['facebook', 'github'],
fruit: ['苹果'],
2017-04-27 14:33:25 +08:00
tags: []
2017-03-01 17:58:40 +08:00
}
},
2017-04-27 14:33:25 +08:00
mounted () {
setTimeout(() => {
this.tags = [
{
label: '香蕉'
},
{
label: '苹果'
},
{
label: '西瓜'
}
]
}, 1000);
2017-03-01 17:58:40 +08:00
}
}
</script>