123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- <template>
- <view class="u-radio-group u-clearfix">
- <slot></slot>
- </view>
- </template>
- <script>
- import Emitter from '../../libs/util/emitter.js';
-
- export default {
- name: "u-radio-group",
- mixins: [Emitter],
- props: {
-
- disabled: {
- type: Boolean,
- default: false
- },
-
- value: {
- type: [String, Number],
- default: ''
- },
-
- activeColor: {
- type: String,
- default: '#2979ff'
- },
-
- size: {
- type: [String, Number],
- default: 34
- },
-
- width: {
- type: String,
- default: 'auto'
- },
-
- wrap: {
- type: Boolean,
- default: false
- }
- },
- provide() {
- return {
- radioGroup: this
- }
- },
- methods: {
-
- setValue(val) {
-
- this.$emit('input', val);
-
- this.$nextTick(function() {
- this.$emit('change', this.value);
-
-
- this.dispatch('u-form-item', 'on-form-change', this.value);
- });
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .u-radio-group {
-
- display: inline-flex;
- flex-wrap: wrap;
-
- }
- </style>
|