index.js 545 B

12345678910111213141516171819202122
  1. import { VantComponent } from '../common/component';
  2. import { useChildren } from '../common/relation';
  3. VantComponent({
  4. field: true,
  5. relation: useChildren('radio'),
  6. props: {
  7. value: {
  8. type: null,
  9. observer: 'updateChildren',
  10. },
  11. direction: String,
  12. disabled: {
  13. type: Boolean,
  14. observer: 'updateChildren',
  15. },
  16. },
  17. methods: {
  18. updateChildren() {
  19. this.children.forEach((child) => child.updateFromParent());
  20. },
  21. },
  22. });