UNPKG

antd-mini

Version:

antd-mini 是支付宝小程序 UI 组件库,遵循 Ant Design 规范。

34 lines (33 loc) 860 B
import mixinValue from '../mixins/value'; import { Component, triggerEvent } from '../_util/simply'; import { isAilpayNative } from '../_util/support'; import { RadioDefaultProps } from './props'; Component({ data: { isLabelSupport: true, }, props: RadioDefaultProps, onInit: function () { this.setData({ isLabelSupport: !isAilpayNative(), }); }, methods: { handleTap: function (e) { // 只能从 false -> true if (this.getValue()) { return; } if (!this.isControlled()) { this.update(true); } triggerEvent(this, 'change', true, e); }, }, mixins: [ mixinValue({ valueKey: 'checked', defaultValueKey: 'defaultChecked', }), ], });