[improvement] CheckboxGroup: jsx (#2498)

This commit is contained in:
neverland 2019-01-11 22:11:41 +08:00 committed by GitHub
parent 543928a57b
commit 3bb15e026b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 25 deletions

View File

@ -0,0 +1,21 @@
import { use } from '../utils';
const [sfc, bem] = use('checkbox-group');
export default sfc({
props: {
max: Number,
value: Array,
disabled: Boolean
},
watch: {
value(val) {
this.$emit('change', val);
}
},
render(h) {
return <div class={bem()}>{this.$slots.default}</div>;
}
});

View File

@ -1,25 +0,0 @@
<template>
<div :class="b()">
<slot />
</div>
</template>
<script>
import create from '../utils/create';
export default create({
name: 'checkbox-group',
props: {
max: Number,
value: Array,
disabled: Boolean
},
watch: {
value(val) {
this.$emit('change', val);
}
}
});
</script>