index.js 784 B

1234567891011121314151617181920212223242526272829303132
  1. import { createNamespace } from '../utils';
  2. import { FieldMixin } from '../mixins/field';
  3. import { ParentMixin } from '../mixins/relation';
  4. var _createNamespace = createNamespace('radio-group'),
  5. createComponent = _createNamespace[0],
  6. bem = _createNamespace[1];
  7. export default createComponent({
  8. mixins: [ParentMixin('vanRadio'), FieldMixin],
  9. props: {
  10. value: null,
  11. disabled: Boolean,
  12. direction: String,
  13. checkedColor: String,
  14. iconSize: [Number, String]
  15. },
  16. watch: {
  17. value: function value(_value) {
  18. this.$emit('change', _value);
  19. }
  20. },
  21. render: function render() {
  22. var h = arguments[0];
  23. return h("div", {
  24. "class": bem([this.direction]),
  25. "attrs": {
  26. "role": "radiogroup"
  27. }
  28. }, [this.slots()]);
  29. }
  30. });