[improvement] RadioGroup: jsx (#2618)

This commit is contained in:
neverland 2019-01-25 21:17:21 +08:00 committed by GitHub
parent f8892d583d
commit 11dd76d6b2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 24 deletions

View File

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

View File

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