Commit 39e6e965639ba1c6d5033aa494452ba9079338a1

Authored by 梁灏
1 parent e9ba11a5

fixed checkbox bug in vue.js 1.0.27

fixed checkbox bug in vue.js 1.0.27
components/checkbox/checkbox-group.vue
... ... @@ -35,6 +35,7 @@
35 35 });
36 36 },
37 37 change (data) {
  38 + this.model = data;
38 39 this.$emit('on-change', data);
39 40 }
40 41 },
... ...
local/routers/index.vue
... ... @@ -3,19 +3,32 @@
3 3 </style>
4 4 <template>
5 5 <div>welcome</div>
  6 + <Checkbox-group :model.sync="fruit">
  7 + <Checkbox value="香蕉"></Checkbox>
  8 + <Checkbox value="苹果"></Checkbox>
  9 + <Checkbox value="西瓜"></Checkbox>
  10 + </Checkbox-group>
  11 + {{ fruit | json }}
  12 + <Button @click="update">update fruit</Button>
6 13 </template>
7 14 <script>
  15 + import { Checkbox, Icon, Button } from 'iview';
  16 + const CheckboxGroup = Checkbox.Group;
  17 +
8 18 export default {
  19 + components: { Checkbox, CheckboxGroup, Icon, Button },
9 20 props: {
10 21  
11 22 },
12 23 data () {
13 24 return {
14   -
  25 + fruit: ['苹果']
15 26 }
16 27 },
17 28 methods: {
18   -
  29 + update () {
  30 + this.fruit = ['香蕉', '西瓜']
  31 + }
19 32 }
20 33 }
21 34 </script>
... ...
package.json
1 1 {
2 2 "name": "iview",
3   - "version": "0.9.0",
  3 + "version": "0.9.1",
4 4 "title": "iView",
5 5 "description": "A high quality UI components Library with Vue.js",
6 6 "homepage": "http://www.iviewui.com",
... ...