fixed checkbox bug in vue.js 1.0.27
fixed checkbox bug in vue.js 1.0.27
This commit is contained in:
parent
e9ba11a569
commit
39e6e96563
3 changed files with 17 additions and 3 deletions
|
@ -35,6 +35,7 @@
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
change (data) {
|
change (data) {
|
||||||
|
this.model = data;
|
||||||
this.$emit('on-change', data);
|
this.$emit('on-change', data);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -3,19 +3,32 @@
|
||||||
</style>
|
</style>
|
||||||
<template>
|
<template>
|
||||||
<div>welcome</div>
|
<div>welcome</div>
|
||||||
|
<Checkbox-group :model.sync="fruit">
|
||||||
|
<Checkbox value="香蕉"></Checkbox>
|
||||||
|
<Checkbox value="苹果"></Checkbox>
|
||||||
|
<Checkbox value="西瓜"></Checkbox>
|
||||||
|
</Checkbox-group>
|
||||||
|
{{ fruit | json }}
|
||||||
|
<Button @click="update">update fruit</Button>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
|
import { Checkbox, Icon, Button } from 'iview';
|
||||||
|
const CheckboxGroup = Checkbox.Group;
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
components: { Checkbox, CheckboxGroup, Icon, Button },
|
||||||
props: {
|
props: {
|
||||||
|
|
||||||
},
|
},
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
|
fruit: ['苹果']
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
update () {
|
||||||
|
this.fruit = ['香蕉', '西瓜']
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "iview",
|
"name": "iview",
|
||||||
"version": "0.9.0",
|
"version": "0.9.1",
|
||||||
"title": "iView",
|
"title": "iView",
|
||||||
"description": "A high quality UI components Library with Vue.js",
|
"description": "A high quality UI components Library with Vue.js",
|
||||||
"homepage": "http://www.iviewui.com",
|
"homepage": "http://www.iviewui.com",
|
||||||
|
|
Loading…
Add table
Reference in a new issue