@vant/weapp
Version:
轻量、可靠的小程序 UI 组件库
23 lines (22 loc) • 545 B
JavaScript
import { VantComponent } from '../common/component';
import { useChildren } from '../common/relation';
VantComponent({
field: true,
relation: useChildren('radio'),
props: {
value: {
type: null,
observer: 'updateChildren',
},
direction: String,
disabled: {
type: Boolean,
observer: 'updateChildren',
},
},
methods: {
updateChildren() {
this.children.forEach((child) => child.updateFromParent());
},
},
});