index.vue 1020 B

123456789101112131415161718192021222324252627282930313233343536
  1. <template>
  2. <uni-shadow-root class="vant-radio-group-index"><view :class="utils.bem('radio-group', [direction])">
  3. <slot></slot>
  4. </view></uni-shadow-root>
  5. </template>
  6. <wxs src="../wxs/utils.wxs" module="utils"></wxs>
  7. <script>
  8. global['__wxRoute'] = 'vant/radio-group/index'
  9. import { VantComponent } from '../common/component';
  10. import { useChildren } from '../common/relation';
  11. VantComponent({
  12. field: true,
  13. relation: useChildren('radio'),
  14. props: {
  15. value: {
  16. type: null,
  17. observer: 'updateChildren',
  18. },
  19. direction: String,
  20. disabled: {
  21. type: Boolean,
  22. observer: 'updateChildren',
  23. },
  24. },
  25. methods: {
  26. updateChildren() {
  27. this.children.forEach((child) => child.updateFromParent());
  28. },
  29. },
  30. });
  31. export default global['__wxComponents']['vant/radio-group/index']
  32. </script>
  33. <style platform="mp-weixin">
  34. @import '../common/index.css';.van-radio-group--horizontal{display:flex;flex-wrap:wrap}
  35. </style>