Commit 39e6e965639ba1c6d5033aa494452ba9079338a1
1 parent
e9ba11a5
fixed checkbox bug in vue.js 1.0.27
fixed checkbox bug in vue.js 1.0.27
Showing
3 changed files
with
17 additions
and
3 deletions
Show diff stats
components/checkbox/checkbox-group.vue
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> | ... | ... |