mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
[improvement] RadioGroup: jsx (#2618)
This commit is contained in:
parent
f8892d583d
commit
11dd76d6b2
20
packages/radio-group/index.js
Normal file
20
packages/radio-group/index.js
Normal 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>;
|
||||||
|
}
|
||||||
|
});
|
@ -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>
|
|
Loading…
x
Reference in New Issue
Block a user