u-radio.js 6.2 KB

1234567891011
  1. (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["uni_modules/uview-ui/components/u-radio/u-radio"],{429:function(e,t,i){"use strict";i.r(t);var n=i(430),a=i(432);for(var r in a)["default"].indexOf(r)<0&&function(e){i.d(t,e,(function(){return a[e]}))}(r);i(435);var o,l=i(36),s=Object(l["default"])(a["default"],n["render"],n["staticRenderFns"],!1,null,"5dfbf8b1",null,!1,n["components"],o);s.options.__file="uni_modules/uview-ui/components/u-radio/u-radio.vue",t["default"]=s.exports},430:function(e,t,i){"use strict";i.r(t);var n=i(431);i.d(t,"render",(function(){return n["render"]})),i.d(t,"staticRenderFns",(function(){return n["staticRenderFns"]})),i.d(t,"recyclableRender",(function(){return n["recyclableRender"]})),i.d(t,"components",(function(){return n["components"]}))},431:function(e,t,i){"use strict";var n;i.r(t),i.d(t,"render",(function(){return a})),i.d(t,"staticRenderFns",(function(){return o})),i.d(t,"recyclableRender",(function(){return r})),i.d(t,"components",(function(){return n}));try{n={uIcon:function(){return Promise.all([i.e("common/vendor"),i.e("uni_modules/uview-ui/components/u-icon/u-icon")]).then(i.bind(null,283))}}}catch(l){if(-1===l.message.indexOf("Cannot find module")||-1===l.message.indexOf(".vue"))throw l;console.error(l.message),console.error("1. 排查组件名称拼写是否正确"),console.error("2. 排查组件是否符合 easycom 规范,文档:https://uniapp.dcloud.net.cn/collocation/pages?id=easycom"),console.error("3. 若组件不符合 easycom 规范,需手动引入,并在 components 中注册该组件")}var a=function(){var e=this,t=e.$createElement,i=(e._self._c,e.__get_style([e.radioStyle])),n=e.__get_style([e.iconWrapStyle]);e.$mp.data=Object.assign({},{$root:{s0:i,s1:n}})},r=!1,o=[];a._withStripped=!0},432:function(e,t,i){"use strict";i.r(t);var n=i(433),a=i.n(n);for(var r in n)["default"].indexOf(r)<0&&function(e){i.d(t,e,(function(){return n[e]}))}(r);t["default"]=a.a},433:function(e,t,i){"use strict";(function(e){var n=i(4);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=n(i(434)),r={name:"u-radio",mixins:[e.$u.mpMixin,e.$u.mixin,a.default],data:function(){return{checked:!1,parentData:{iconSize:12,labelDisabled:null,disabled:null,shape:null,activeColor:null,inactiveColor:null,size:18,value:null,iconColor:null,placement:"row",borderBottom:!1,iconPlacement:"left"}}},computed:{elDisabled:function(){return""!==this.disabled?this.disabled:null!==this.parentData.disabled&&this.parentData.disabled},elLabelDisabled:function(){return""!==this.labelDisabled?this.labelDisabled:null!==this.parentData.labelDisabled&&this.parentData.labelDisabled},elSize:function(){return this.size?this.size:this.parentData.size?this.parentData.size:21},elIconSize:function(){return this.iconSize?this.iconSize:this.parentData.iconSize?this.parentData.iconSize:12},elActiveColor:function(){return this.activeColor?this.activeColor:this.parentData.activeColor?this.parentData.activeColor:"#2979ff"},elInactiveColor:function(){return this.inactiveColor?this.inactiveColor:this.parentData.inactiveColor?this.parentData.inactiveColor:"#c8c9cc"},elLabelColor:function(){return this.labelColor?this.labelColor:this.parentData.labelColor?this.parentData.labelColor:"#606266"},elShape:function(){return this.shape?this.shape:this.parentData.shape?this.parentData.shape:"circle"},elLabelSize:function(){return e.$u.addUnit(this.labelSize?this.labelSize:this.parentData.labelSize?this.parentData.labelSize:"15")},elIconColor:function(){var e=this.iconColor?this.iconColor:this.parentData.iconColor?this.parentData.iconColor:"#ffffff";return this.elDisabled?this.checked?this.elInactiveColor:"transparent":this.checked?e:"transparent"},iconClasses:function(){var e=[];return e.push("u-radio__icon-wrap--"+this.elShape),this.elDisabled&&e.push("u-radio__icon-wrap--disabled"),this.checked&&this.elDisabled&&e.push("u-radio__icon-wrap--disabled--checked"),e},iconWrapStyle:function(){var t={};return t.backgroundColor=this.checked&&!this.elDisabled?this.elActiveColor:"#ffffff",t.borderColor=this.checked&&!this.elDisabled?this.elActiveColor:this.elInactiveColor,t.width=e.$u.addUnit(this.elSize),t.height=e.$u.addUnit(this.elSize),"right"===this.parentData.iconPlacement&&(t.marginRight=0),t},radioStyle:function(){var t={};return this.parentData.borderBottom&&"row"===this.parentData.placement&&e.$u.error("检测到您将borderBottom设置为true,需要同时将u-radio-group的placement设置为column才有效"),this.parentData.borderBottom&&"column"===this.parentData.placement&&(t.paddingBottom="ios"===e.$u.os()?"12px":"8px"),e.$u.deepMerge(t,e.$u.addStyle(this.customStyle))}},mounted:function(){this.init()},methods:{init:function(){this.updateParentData(),this.parent||e.$u.error("u-radio必须搭配u-radio-group组件使用"),this.checked=this.name===this.parentData.value},updateParentData:function(){this.getParentData("u-radio-group")},iconClickHandler:function(e){this.preventEvent(e),this.elDisabled||this.setRadioCheckedStatus()},wrapperClickHandler:function(e){"right"===this.parentData.iconPlacement&&this.iconClickHandler(e)},labelClickHandler:function(e){this.preventEvent(e),this.elLabelDisabled||this.elDisabled||this.setRadioCheckedStatus()},emitEvent:function(){var t=this;this.checked||(this.$emit("change",this.name),this.$nextTick((function(){e.$u.formValidate(t,"change")})))},setRadioCheckedStatus:function(){this.emitEvent(),this.checked=!0,"function"===typeof this.parent.unCheckedOther&&this.parent.unCheckedOther(this)}}};t.default=r}).call(this,i(2)["default"])},435:function(e,t,i){"use strict";i.r(t);var n=i(436),a=i.n(n);for(var r in n)["default"].indexOf(r)<0&&function(e){i.d(t,e,(function(){return n[e]}))}(r);t["default"]=a.a},436:function(e,t,i){}}]);
  2. //# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/uview-ui/components/u-radio/u-radio.js.map
  3. ;(global["webpackJsonp"] = global["webpackJsonp"] || []).push([
  4. 'uni_modules/uview-ui/components/u-radio/u-radio-create-component',
  5. {
  6. 'uni_modules/uview-ui/components/u-radio/u-radio-create-component':(function(module, exports, __webpack_require__){
  7. __webpack_require__('2')['createComponent'](__webpack_require__(429))
  8. })
  9. },
  10. [['uni_modules/uview-ui/components/u-radio/u-radio-create-component']]
  11. ]);