u-radio.js 40 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430
  1. (global["webpackJsonp"] = global["webpackJsonp"] || []).push([["uni_modules/uview-ui/components/u-radio/u-radio"],{
  2. /***/ 413:
  3. /*!*******************************************************************************!*\
  4. !*** E:/ios/iot-test-app/uni_modules/uview-ui/components/u-radio/u-radio.vue ***!
  5. \*******************************************************************************/
  6. /*! no static exports found */
  7. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8. "use strict";
  9. __webpack_require__.r(__webpack_exports__);
  10. /* harmony import */ var _u_radio_vue_vue_type_template_id_5dfbf8b1_scoped_true___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./u-radio.vue?vue&type=template&id=5dfbf8b1&scoped=true& */ 414);
  11. /* harmony import */ var _u_radio_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./u-radio.vue?vue&type=script&lang=js& */ 416);
  12. /* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _u_radio_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__) if(["default"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _u_radio_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  13. /* harmony import */ var _u_radio_vue_vue_type_style_index_0_id_5dfbf8b1_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./u-radio.vue?vue&type=style&index=0&id=5dfbf8b1&lang=scss&scoped=true& */ 419);
  14. /* harmony import */ var _D_gugedownload_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js */ 36);
  15. var renderjs
  16. /* normalize component */
  17. var component = Object(_D_gugedownload_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_3__["default"])(
  18. _u_radio_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"],
  19. _u_radio_vue_vue_type_template_id_5dfbf8b1_scoped_true___WEBPACK_IMPORTED_MODULE_0__["render"],
  20. _u_radio_vue_vue_type_template_id_5dfbf8b1_scoped_true___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"],
  21. false,
  22. null,
  23. "5dfbf8b1",
  24. null,
  25. false,
  26. _u_radio_vue_vue_type_template_id_5dfbf8b1_scoped_true___WEBPACK_IMPORTED_MODULE_0__["components"],
  27. renderjs
  28. )
  29. component.options.__file = "uni_modules/uview-ui/components/u-radio/u-radio.vue"
  30. /* harmony default export */ __webpack_exports__["default"] = (component.exports);
  31. /***/ }),
  32. /***/ 414:
  33. /*!**************************************************************************************************************************!*\
  34. !*** E:/ios/iot-test-app/uni_modules/uview-ui/components/u-radio/u-radio.vue?vue&type=template&id=5dfbf8b1&scoped=true& ***!
  35. \**************************************************************************************************************************/
  36. /*! exports provided: render, staticRenderFns, recyclableRender, components */
  37. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  38. "use strict";
  39. __webpack_require__.r(__webpack_exports__);
  40. /* harmony import */ var _D_gugedownload_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_D_gugedownload_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_17_0_D_gugedownload_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_template_js_D_gugedownload_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_uni_app_loader_page_meta_js_D_gugedownload_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_gugedownload_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_u_radio_vue_vue_type_template_id_5dfbf8b1_scoped_true___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--17-0!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/template.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-uni-app-loader/page-meta.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./u-radio.vue?vue&type=template&id=5dfbf8b1&scoped=true& */ 415);
  41. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "render", function() { return _D_gugedownload_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_D_gugedownload_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_17_0_D_gugedownload_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_template_js_D_gugedownload_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_uni_app_loader_page_meta_js_D_gugedownload_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_gugedownload_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_u_radio_vue_vue_type_template_id_5dfbf8b1_scoped_true___WEBPACK_IMPORTED_MODULE_0__["render"]; });
  42. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return _D_gugedownload_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_D_gugedownload_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_17_0_D_gugedownload_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_template_js_D_gugedownload_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_uni_app_loader_page_meta_js_D_gugedownload_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_gugedownload_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_u_radio_vue_vue_type_template_id_5dfbf8b1_scoped_true___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"]; });
  43. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "recyclableRender", function() { return _D_gugedownload_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_D_gugedownload_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_17_0_D_gugedownload_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_template_js_D_gugedownload_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_uni_app_loader_page_meta_js_D_gugedownload_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_gugedownload_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_u_radio_vue_vue_type_template_id_5dfbf8b1_scoped_true___WEBPACK_IMPORTED_MODULE_0__["recyclableRender"]; });
  44. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "components", function() { return _D_gugedownload_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_D_gugedownload_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_17_0_D_gugedownload_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_template_js_D_gugedownload_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_uni_app_loader_page_meta_js_D_gugedownload_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_gugedownload_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_u_radio_vue_vue_type_template_id_5dfbf8b1_scoped_true___WEBPACK_IMPORTED_MODULE_0__["components"]; });
  45. /***/ }),
  46. /***/ 415:
  47. /*!**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  48. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--17-0!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/template.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-uni-app-loader/page-meta.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!E:/ios/iot-test-app/uni_modules/uview-ui/components/u-radio/u-radio.vue?vue&type=template&id=5dfbf8b1&scoped=true& ***!
  49. \**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  50. /*! exports provided: render, staticRenderFns, recyclableRender, components */
  51. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  52. "use strict";
  53. __webpack_require__.r(__webpack_exports__);
  54. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "render", function() { return render; });
  55. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return staticRenderFns; });
  56. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "recyclableRender", function() { return recyclableRender; });
  57. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "components", function() { return components; });
  58. var components
  59. try {
  60. components = {
  61. uIcon: function () {
  62. return Promise.all(/*! import() | uni_modules/uview-ui/components/u-icon/u-icon */[__webpack_require__.e("common/vendor"), __webpack_require__.e("uni_modules/uview-ui/components/u-icon/u-icon")]).then(__webpack_require__.bind(null, /*! @/uni_modules/uview-ui/components/u-icon/u-icon.vue */ 283))
  63. },
  64. }
  65. } catch (e) {
  66. if (
  67. e.message.indexOf("Cannot find module") !== -1 &&
  68. e.message.indexOf(".vue") !== -1
  69. ) {
  70. console.error(e.message)
  71. console.error("1. 排查组件名称拼写是否正确")
  72. console.error(
  73. "2. 排查组件是否符合 easycom 规范,文档:https://uniapp.dcloud.net.cn/collocation/pages?id=easycom"
  74. )
  75. console.error(
  76. "3. 若组件不符合 easycom 规范,需手动引入,并在 components 中注册该组件"
  77. )
  78. } else {
  79. throw e
  80. }
  81. }
  82. var render = function () {
  83. var _vm = this
  84. var _h = _vm.$createElement
  85. var _c = _vm._self._c || _h
  86. var s0 = _vm.__get_style([_vm.radioStyle])
  87. var s1 = _vm.__get_style([_vm.iconWrapStyle])
  88. _vm.$mp.data = Object.assign(
  89. {},
  90. {
  91. $root: {
  92. s0: s0,
  93. s1: s1,
  94. },
  95. }
  96. )
  97. }
  98. var recyclableRender = false
  99. var staticRenderFns = []
  100. render._withStripped = true
  101. /***/ }),
  102. /***/ 416:
  103. /*!********************************************************************************************************!*\
  104. !*** E:/ios/iot-test-app/uni_modules/uview-ui/components/u-radio/u-radio.vue?vue&type=script&lang=js& ***!
  105. \********************************************************************************************************/
  106. /*! no static exports found */
  107. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  108. "use strict";
  109. __webpack_require__.r(__webpack_exports__);
  110. /* harmony import */ var _D_gugedownload_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_D_gugedownload_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_13_1_D_gugedownload_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_D_gugedownload_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_gugedownload_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_u_radio_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!./node_modules/babel-loader/lib!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--13-1!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/script.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./u-radio.vue?vue&type=script&lang=js& */ 417);
  111. /* harmony import */ var _D_gugedownload_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_D_gugedownload_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_13_1_D_gugedownload_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_D_gugedownload_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_gugedownload_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_u_radio_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_D_gugedownload_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_D_gugedownload_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_13_1_D_gugedownload_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_D_gugedownload_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_gugedownload_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_u_radio_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__);
  112. /* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _D_gugedownload_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_D_gugedownload_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_13_1_D_gugedownload_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_D_gugedownload_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_gugedownload_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_u_radio_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__) if(["default"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _D_gugedownload_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_D_gugedownload_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_13_1_D_gugedownload_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_D_gugedownload_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_gugedownload_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_u_radio_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  113. /* harmony default export */ __webpack_exports__["default"] = (_D_gugedownload_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_D_gugedownload_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_13_1_D_gugedownload_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_D_gugedownload_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_gugedownload_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_u_radio_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0___default.a);
  114. /***/ }),
  115. /***/ 417:
  116. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  117. !*** ./node_modules/babel-loader/lib!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--13-1!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/script.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!E:/ios/iot-test-app/uni_modules/uview-ui/components/u-radio/u-radio.vue?vue&type=script&lang=js& ***!
  118. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  119. /*! no static exports found */
  120. /***/ (function(module, exports, __webpack_require__) {
  121. "use strict";
  122. /* WEBPACK VAR INJECTION */(function(uni) {
  123. var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
  124. Object.defineProperty(exports, "__esModule", {
  125. value: true
  126. });
  127. exports.default = void 0;
  128. var _props = _interopRequireDefault(__webpack_require__(/*! ./props.js */ 418));
  129. //
  130. //
  131. //
  132. //
  133. //
  134. //
  135. //
  136. //
  137. //
  138. //
  139. //
  140. //
  141. //
  142. //
  143. //
  144. //
  145. //
  146. //
  147. //
  148. //
  149. //
  150. //
  151. //
  152. //
  153. //
  154. //
  155. //
  156. //
  157. //
  158. //
  159. //
  160. //
  161. //
  162. //
  163. //
  164. //
  165. /**
  166. * radio 单选框
  167. * @description 单选框用于有一个选择,用户只能选择其中一个的场景。搭配u-radio-group使用
  168. * @tutorial https://www.uviewui.com/components/radio.html
  169. * @property {String | Number} name radio的名称
  170. * @property {String} shape 形状,square为方形,circle为圆型
  171. * @property {Boolean} disabled 是否禁用
  172. * @property {String | Boolean} labelDisabled 是否禁止点击提示语选中单选框
  173. * @property {String} activeColor 选中时的颜色,如设置parent的active-color将失效
  174. * @property {String} inactiveColor 未选中的颜色
  175. * @property {String | Number} iconSize 图标大小,单位px
  176. * @property {String | Number} labelSize label字体大小,单位px
  177. * @property {String | Number} label label提示文字,因为nvue下,直接slot进来的文字,由于特殊的结构,无法修改样式
  178. * @property {String | Number} size 整体的大小
  179. * @property {String} iconColor 图标颜色
  180. * @property {String} labelColor label的颜色
  181. * @property {Object} customStyle 组件的样式,对象形式
  182. *
  183. * @event {Function} change 某个radio状态发生变化时触发(选中状态)
  184. * @example <u-radio :labelDisabled="false">门掩黄昏,无计留春住</u-radio>
  185. */
  186. var _default = {
  187. name: "u-radio",
  188. mixins: [uni.$u.mpMixin, uni.$u.mixin, _props.default],
  189. data: function data() {
  190. return {
  191. checked: false,
  192. // 当你看到这段代码的时候,
  193. // 父组件的默认值,因为头条小程序不支持在computed中使用this.parent.shape的形式
  194. // 故只能使用如此方法
  195. parentData: {
  196. iconSize: 12,
  197. labelDisabled: null,
  198. disabled: null,
  199. shape: null,
  200. activeColor: null,
  201. inactiveColor: null,
  202. size: 18,
  203. value: null,
  204. iconColor: null,
  205. placement: 'row',
  206. borderBottom: false,
  207. iconPlacement: 'left'
  208. }
  209. };
  210. },
  211. computed: {
  212. // 是否禁用,如果父组件u-raios-group禁用的话,将会忽略子组件的配置
  213. elDisabled: function elDisabled() {
  214. return this.disabled !== '' ? this.disabled : this.parentData.disabled !== null ? this.parentData.disabled : false;
  215. },
  216. // 是否禁用label点击
  217. elLabelDisabled: function elLabelDisabled() {
  218. return this.labelDisabled !== '' ? this.labelDisabled : this.parentData.labelDisabled !== null ? this.parentData.labelDisabled : false;
  219. },
  220. // 组件尺寸,对应size的值,默认值为21px
  221. elSize: function elSize() {
  222. return this.size ? this.size : this.parentData.size ? this.parentData.size : 21;
  223. },
  224. // 组件的勾选图标的尺寸,默认12px
  225. elIconSize: function elIconSize() {
  226. return this.iconSize ? this.iconSize : this.parentData.iconSize ? this.parentData.iconSize : 12;
  227. },
  228. // 组件选中激活时的颜色
  229. elActiveColor: function elActiveColor() {
  230. return this.activeColor ? this.activeColor : this.parentData.activeColor ? this.parentData.activeColor : '#2979ff';
  231. },
  232. // 组件选未中激活时的颜色
  233. elInactiveColor: function elInactiveColor() {
  234. return this.inactiveColor ? this.inactiveColor : this.parentData.inactiveColor ? this.parentData.inactiveColor : '#c8c9cc';
  235. },
  236. // label的颜色
  237. elLabelColor: function elLabelColor() {
  238. return this.labelColor ? this.labelColor : this.parentData.labelColor ? this.parentData.labelColor : '#606266';
  239. },
  240. // 组件的形状
  241. elShape: function elShape() {
  242. return this.shape ? this.shape : this.parentData.shape ? this.parentData.shape : 'circle';
  243. },
  244. // label大小
  245. elLabelSize: function elLabelSize() {
  246. return uni.$u.addUnit(this.labelSize ? this.labelSize : this.parentData.labelSize ? this.parentData.labelSize : '15');
  247. },
  248. elIconColor: function elIconColor() {
  249. var iconColor = this.iconColor ? this.iconColor : this.parentData.iconColor ? this.parentData.iconColor : '#ffffff';
  250. // 图标的颜色
  251. if (this.elDisabled) {
  252. // disabled状态下,已勾选的radio图标改为elInactiveColor
  253. return this.checked ? this.elInactiveColor : 'transparent';
  254. } else {
  255. return this.checked ? iconColor : 'transparent';
  256. }
  257. },
  258. iconClasses: function iconClasses() {
  259. var classes = [];
  260. // 组件的形状
  261. classes.push('u-radio__icon-wrap--' + this.elShape);
  262. if (this.elDisabled) {
  263. classes.push('u-radio__icon-wrap--disabled');
  264. }
  265. if (this.checked && this.elDisabled) {
  266. classes.push('u-radio__icon-wrap--disabled--checked');
  267. }
  268. // 支付宝,头条小程序无法动态绑定一个数组类名,否则解析出来的结果会带有",",而导致失效
  269. return classes;
  270. },
  271. iconWrapStyle: function iconWrapStyle() {
  272. // radio的整体样式
  273. var style = {};
  274. style.backgroundColor = this.checked && !this.elDisabled ? this.elActiveColor : '#ffffff';
  275. style.borderColor = this.checked && !this.elDisabled ? this.elActiveColor : this.elInactiveColor;
  276. style.width = uni.$u.addUnit(this.elSize);
  277. style.height = uni.$u.addUnit(this.elSize);
  278. // 如果是图标在右边的话,移除它的右边距
  279. if (this.parentData.iconPlacement === 'right') {
  280. style.marginRight = 0;
  281. }
  282. return style;
  283. },
  284. radioStyle: function radioStyle() {
  285. var style = {};
  286. if (this.parentData.borderBottom && this.parentData.placement === 'row') {
  287. uni.$u.error('检测到您将borderBottom设置为true,需要同时将u-radio-group的placement设置为column才有效');
  288. }
  289. // 当父组件设置了显示下边框并且排列形式为纵向时,给内容和边框之间加上一定间隔
  290. if (this.parentData.borderBottom && this.parentData.placement === 'column') {
  291. // ios像素密度高,需要多一点的距离
  292. style.paddingBottom = uni.$u.os() === 'ios' ? '12px' : '8px';
  293. }
  294. return uni.$u.deepMerge(style, uni.$u.addStyle(this.customStyle));
  295. }
  296. },
  297. mounted: function mounted() {
  298. this.init();
  299. },
  300. methods: {
  301. init: function init() {
  302. // 支付宝小程序不支持provide/inject,所以使用这个方法获取整个父组件,在created定义,避免循环引用
  303. this.updateParentData();
  304. if (!this.parent) {
  305. uni.$u.error('u-radio必须搭配u-radio-group组件使用');
  306. }
  307. // 设置初始化时,是否默认选中的状态
  308. this.checked = this.name === this.parentData.value;
  309. },
  310. updateParentData: function updateParentData() {
  311. this.getParentData('u-radio-group');
  312. },
  313. // 点击图标
  314. iconClickHandler: function iconClickHandler(e) {
  315. this.preventEvent(e);
  316. // 如果整体被禁用,不允许被点击
  317. if (!this.elDisabled) {
  318. this.setRadioCheckedStatus();
  319. }
  320. },
  321. // 横向两端排列时,点击组件即可触发选中事件
  322. wrapperClickHandler: function wrapperClickHandler(e) {
  323. this.parentData.iconPlacement === 'right' && this.iconClickHandler(e);
  324. },
  325. // 点击label
  326. labelClickHandler: function labelClickHandler(e) {
  327. this.preventEvent(e);
  328. // 如果按钮整体被禁用或者label被禁用,则不允许点击文字修改状态
  329. if (!this.elLabelDisabled && !this.elDisabled) {
  330. this.setRadioCheckedStatus();
  331. }
  332. },
  333. emitEvent: function emitEvent() {
  334. var _this = this;
  335. // u-radio的checked不为true时(意味着未选中),才发出事件,避免多次点击触发事件
  336. if (!this.checked) {
  337. this.$emit('change', this.name);
  338. // 尝试调用u-form的验证方法,进行一定延迟,否则微信小程序更新可能会不及时
  339. this.$nextTick(function () {
  340. uni.$u.formValidate(_this, 'change');
  341. });
  342. }
  343. },
  344. // 改变组件选中状态
  345. // 这里的改变的依据是,更改本组件的checked值为true,同时通过父组件遍历所有u-radio实例
  346. // 将本组件外的其他u-radio的checked都设置为false(都被取消选中状态),因而只剩下一个为选中状态
  347. setRadioCheckedStatus: function setRadioCheckedStatus() {
  348. this.emitEvent();
  349. // 将本组件标记为选中状态
  350. this.checked = true;
  351. typeof this.parent.unCheckedOther === 'function' && this.parent.unCheckedOther(this);
  352. }
  353. }
  354. };
  355. exports.default = _default;
  356. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  357. /***/ }),
  358. /***/ 419:
  359. /*!*****************************************************************************************************************************************!*\
  360. !*** E:/ios/iot-test-app/uni_modules/uview-ui/components/u-radio/u-radio.vue?vue&type=style&index=0&id=5dfbf8b1&lang=scss&scoped=true& ***!
  361. \*****************************************************************************************************************************************/
  362. /*! no static exports found */
  363. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  364. "use strict";
  365. __webpack_require__.r(__webpack_exports__);
  366. /* harmony import */ var _D_gugedownload_HBuilderX_plugins_uniapp_cli_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_D_gugedownload_HBuilderX_plugins_uniapp_cli_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_D_gugedownload_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_stylePostLoader_js_D_gugedownload_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_2_D_gugedownload_HBuilderX_plugins_uniapp_cli_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_3_D_gugedownload_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_sass_loader_dist_cjs_js_ref_8_oneOf_1_4_D_gugedownload_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_5_D_gugedownload_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_gugedownload_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_u_radio_vue_vue_type_style_index_0_id_5dfbf8b1_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!./node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!./node_modules/css-loader/dist/cjs.js??ref--8-oneOf-1-1!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--8-oneOf-1-2!./node_modules/postcss-loader/src??ref--8-oneOf-1-3!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/sass-loader/dist/cjs.js??ref--8-oneOf-1-4!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--8-oneOf-1-5!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./u-radio.vue?vue&type=style&index=0&id=5dfbf8b1&lang=scss&scoped=true& */ 420);
  367. /* harmony import */ var _D_gugedownload_HBuilderX_plugins_uniapp_cli_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_D_gugedownload_HBuilderX_plugins_uniapp_cli_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_D_gugedownload_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_stylePostLoader_js_D_gugedownload_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_2_D_gugedownload_HBuilderX_plugins_uniapp_cli_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_3_D_gugedownload_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_sass_loader_dist_cjs_js_ref_8_oneOf_1_4_D_gugedownload_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_5_D_gugedownload_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_gugedownload_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_u_radio_vue_vue_type_style_index_0_id_5dfbf8b1_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_D_gugedownload_HBuilderX_plugins_uniapp_cli_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_D_gugedownload_HBuilderX_plugins_uniapp_cli_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_D_gugedownload_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_stylePostLoader_js_D_gugedownload_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_2_D_gugedownload_HBuilderX_plugins_uniapp_cli_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_3_D_gugedownload_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_sass_loader_dist_cjs_js_ref_8_oneOf_1_4_D_gugedownload_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_5_D_gugedownload_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_gugedownload_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_u_radio_vue_vue_type_style_index_0_id_5dfbf8b1_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0__);
  368. /* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _D_gugedownload_HBuilderX_plugins_uniapp_cli_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_D_gugedownload_HBuilderX_plugins_uniapp_cli_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_D_gugedownload_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_stylePostLoader_js_D_gugedownload_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_2_D_gugedownload_HBuilderX_plugins_uniapp_cli_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_3_D_gugedownload_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_sass_loader_dist_cjs_js_ref_8_oneOf_1_4_D_gugedownload_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_5_D_gugedownload_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_gugedownload_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_u_radio_vue_vue_type_style_index_0_id_5dfbf8b1_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0__) if(["default"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _D_gugedownload_HBuilderX_plugins_uniapp_cli_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_D_gugedownload_HBuilderX_plugins_uniapp_cli_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_D_gugedownload_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_stylePostLoader_js_D_gugedownload_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_2_D_gugedownload_HBuilderX_plugins_uniapp_cli_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_3_D_gugedownload_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_sass_loader_dist_cjs_js_ref_8_oneOf_1_4_D_gugedownload_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_5_D_gugedownload_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_gugedownload_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_u_radio_vue_vue_type_style_index_0_id_5dfbf8b1_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  369. /* harmony default export */ __webpack_exports__["default"] = (_D_gugedownload_HBuilderX_plugins_uniapp_cli_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_D_gugedownload_HBuilderX_plugins_uniapp_cli_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_D_gugedownload_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_stylePostLoader_js_D_gugedownload_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_2_D_gugedownload_HBuilderX_plugins_uniapp_cli_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_3_D_gugedownload_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_sass_loader_dist_cjs_js_ref_8_oneOf_1_4_D_gugedownload_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_5_D_gugedownload_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_gugedownload_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_u_radio_vue_vue_type_style_index_0_id_5dfbf8b1_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0___default.a);
  370. /***/ }),
  371. /***/ 420:
  372. /*!*********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  373. !*** ./node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!./node_modules/css-loader/dist/cjs.js??ref--8-oneOf-1-1!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--8-oneOf-1-2!./node_modules/postcss-loader/src??ref--8-oneOf-1-3!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/sass-loader/dist/cjs.js??ref--8-oneOf-1-4!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--8-oneOf-1-5!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!E:/ios/iot-test-app/uni_modules/uview-ui/components/u-radio/u-radio.vue?vue&type=style&index=0&id=5dfbf8b1&lang=scss&scoped=true& ***!
  374. \*********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  375. /*! no static exports found */
  376. /***/ (function(module, exports, __webpack_require__) {
  377. // extracted by mini-css-extract-plugin
  378. if(false) { var cssReload; }
  379. /***/ })
  380. }]);
  381. //# sourceMappingURL=../../../../../.sourcemap/mp-weixin/uni_modules/uview-ui/components/u-radio/u-radio.js.map
  382. ;(global["webpackJsonp"] = global["webpackJsonp"] || []).push([
  383. 'uni_modules/uview-ui/components/u-radio/u-radio-create-component',
  384. {
  385. 'uni_modules/uview-ui/components/u-radio/u-radio-create-component':(function(module, exports, __webpack_require__){
  386. __webpack_require__('2')['createComponent'](__webpack_require__(413))
  387. })
  388. },
  389. [['uni_modules/uview-ui/components/u-radio/u-radio-create-component']]
  390. ]);