u-form-item.js 43 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557
  1. (global["webpackJsonp"] = global["webpackJsonp"] || []).push([["uview-ui/components/u-form-item/u-form-item"],{
  2. /***/ 319:
  3. /*!**************************************************************************************!*\
  4. !*** D:/星火篮球维护/代码/小程序销售端/spark-sale/uview-ui/components/u-form-item/u-form-item.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_form_item_vue_vue_type_template_id_006449ec_scoped_true___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./u-form-item.vue?vue&type=template&id=006449ec&scoped=true& */ 320);
  11. /* harmony import */ var _u_form_item_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./u-form-item.vue?vue&type=script&lang=js& */ 322);
  12. /* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _u_form_item_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _u_form_item_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  13. /* harmony import */ var _u_form_item_vue_vue_type_style_index_0_id_006449ec_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./u-form-item.vue?vue&type=style&index=0&id=006449ec&lang=scss&scoped=true& */ 327);
  14. /* harmony import */ var _E_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 */ 10);
  15. var renderjs
  16. /* normalize component */
  17. var component = Object(_E_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_form_item_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"],
  19. _u_form_item_vue_vue_type_template_id_006449ec_scoped_true___WEBPACK_IMPORTED_MODULE_0__["render"],
  20. _u_form_item_vue_vue_type_template_id_006449ec_scoped_true___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"],
  21. false,
  22. null,
  23. "006449ec",
  24. null,
  25. false,
  26. _u_form_item_vue_vue_type_template_id_006449ec_scoped_true___WEBPACK_IMPORTED_MODULE_0__["components"],
  27. renderjs
  28. )
  29. component.options.__file = "uview-ui/components/u-form-item/u-form-item.vue"
  30. /* harmony default export */ __webpack_exports__["default"] = (component.exports);
  31. /***/ }),
  32. /***/ 320:
  33. /*!*********************************************************************************************************************************!*\
  34. !*** D:/星火篮球维护/代码/小程序销售端/spark-sale/uview-ui/components/u-form-item/u-form-item.vue?vue&type=template&id=006449ec&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 _E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_16_0_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_template_js_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_uni_app_loader_page_meta_js_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_u_form_item_vue_vue_type_template_id_006449ec_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--16-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-form-item.vue?vue&type=template&id=006449ec&scoped=true& */ 321);
  41. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "render", function() { return _E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_16_0_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_template_js_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_uni_app_loader_page_meta_js_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_u_form_item_vue_vue_type_template_id_006449ec_scoped_true___WEBPACK_IMPORTED_MODULE_0__["render"]; });
  42. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return _E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_16_0_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_template_js_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_uni_app_loader_page_meta_js_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_u_form_item_vue_vue_type_template_id_006449ec_scoped_true___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"]; });
  43. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "recyclableRender", function() { return _E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_16_0_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_template_js_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_uni_app_loader_page_meta_js_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_u_form_item_vue_vue_type_template_id_006449ec_scoped_true___WEBPACK_IMPORTED_MODULE_0__["recyclableRender"]; });
  44. /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "components", function() { return _E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_16_0_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_template_js_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_uni_app_loader_page_meta_js_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_u_form_item_vue_vue_type_template_id_006449ec_scoped_true___WEBPACK_IMPORTED_MODULE_0__["components"]; });
  45. /***/ }),
  46. /***/ 321:
  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--16-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!D:/星火篮球维护/代码/小程序销售端/spark-sale/uview-ui/components/u-form-item/u-form-item.vue?vue&type=template&id=006449ec&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 __webpack_require__.e(/*! import() | uview-ui/components/u-icon/u-icon */ "uview-ui/components/u-icon/u-icon").then(__webpack_require__.bind(null, /*! @/uview-ui/components/u-icon/u-icon.vue */ 259))
  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 m0 = _vm.validateState === "error" && _vm.showError("border-bottom")
  87. var s0 =
  88. _vm.required || _vm.leftIcon || _vm.label
  89. ? _vm.__get_style([
  90. _vm.elLabelStyle,
  91. {
  92. "justify-content":
  93. _vm.elLabelAlign == "left"
  94. ? "flex-start"
  95. : _vm.elLabelAlign == "center"
  96. ? "center"
  97. : "flex-end"
  98. }
  99. ])
  100. : null
  101. var m1 = _vm.validateState === "error" && _vm.showError("message")
  102. var g0 =
  103. m1 && _vm.elLabelPosition == "left"
  104. ? _vm.$u.addUnit(_vm.elLabelWidth)
  105. : null
  106. _vm.$mp.data = Object.assign(
  107. {},
  108. {
  109. $root: {
  110. m0: m0,
  111. s0: s0,
  112. m1: m1,
  113. g0: g0
  114. }
  115. }
  116. )
  117. }
  118. var recyclableRender = false
  119. var staticRenderFns = []
  120. render._withStripped = true
  121. /***/ }),
  122. /***/ 322:
  123. /*!***************************************************************************************************************!*\
  124. !*** D:/星火篮球维护/代码/小程序销售端/spark-sale/uview-ui/components/u-form-item/u-form-item.vue?vue&type=script&lang=js& ***!
  125. \***************************************************************************************************************/
  126. /*! no static exports found */
  127. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  128. "use strict";
  129. __webpack_require__.r(__webpack_exports__);
  130. /* harmony import */ var _E_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_12_1_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_u_form_item_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--12-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-form-item.vue?vue&type=script&lang=js& */ 323);
  131. /* harmony import */ var _E_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_12_1_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_u_form_item_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_E_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_12_1_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_u_form_item_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__);
  132. /* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _E_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_12_1_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_u_form_item_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _E_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_12_1_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_u_form_item_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  133. /* harmony default export */ __webpack_exports__["default"] = (_E_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_12_1_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_u_form_item_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0___default.a);
  134. /***/ }),
  135. /***/ 323:
  136. /*!**********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  137. !*** ./node_modules/babel-loader/lib!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--12-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!D:/星火篮球维护/代码/小程序销售端/spark-sale/uview-ui/components/u-form-item/u-form-item.vue?vue&type=script&lang=js& ***!
  138. \**********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  139. /*! no static exports found */
  140. /***/ (function(module, exports, __webpack_require__) {
  141. "use strict";
  142. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;
  143. var _emitter = _interopRequireDefault(__webpack_require__(/*! ../../libs/util/emitter.js */ 302));
  144. var _asyncValidator = _interopRequireDefault(__webpack_require__(/*! ../../libs/util/async-validator */ 324));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}function _defineProperty(obj, key, value) {if (key in obj) {Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });} else {obj[key] = value;}return obj;}
  145. // 去除警告信息
  146. _asyncValidator.default.warning = function () {};
  147. /**
  148. * form-item 表单item
  149. * @description 此组件一般用于表单场景,可以配置Input输入框,Select弹出框,进行表单验证等。
  150. * @tutorial http://uviewui.com/components/form.html
  151. * @property {String} label 左侧提示文字
  152. * @property {Object} prop 表单域model对象的属性名,在使用 validate、resetFields 方法的情况下,该属性是必填的
  153. * @property {Boolean} border-bottom 是否显示表单域的下划线边框
  154. * @property {String} label-position 表单域提示文字的位置,left-左侧,top-上方
  155. * @property {String Number} label-width 提示文字的宽度,单位rpx(默认90)
  156. * @property {Object} label-style lable的样式,对象形式
  157. * @property {String} label-align lable的对齐方式
  158. * @property {String} right-icon 右侧自定义字体图标(限uView内置图标)或图片地址
  159. * @property {String} left-icon 左侧自定义字体图标(限uView内置图标)或图片地址
  160. * @property {Object} left-icon-style 左侧图标的样式,对象形式
  161. * @property {Object} right-icon-style 右侧图标的样式,对象形式
  162. * @property {Boolean} required 是否显示左边的"*"号,这里仅起展示作用,如需校验必填,请通过rules配置必填规则(默认false)
  163. * @example <u-form-item label="姓名"><u-input v-model="form.name" /></u-form-item>
  164. */var _default2 =
  165. {
  166. name: 'u-form-item',
  167. mixins: [_emitter.default],
  168. inject: {
  169. uForm: {
  170. default: function _default() {
  171. return null;
  172. } } },
  173. props: {
  174. // input的label提示语
  175. label: {
  176. type: String,
  177. default: '' },
  178. // 绑定的值
  179. prop: {
  180. type: String,
  181. default: '' },
  182. // 是否显示表单域的下划线边框
  183. borderBottom: {
  184. type: [String, Boolean],
  185. default: '' },
  186. // label的位置,left-左边,top-上边
  187. labelPosition: {
  188. type: String,
  189. default: '' },
  190. // label的宽度,单位rpx
  191. labelWidth: {
  192. type: [String, Number],
  193. default: '' },
  194. // lable的样式,对象形式
  195. labelStyle: {
  196. type: Object,
  197. default: function _default() {
  198. return {};
  199. } },
  200. // lable字体的对齐方式
  201. labelAlign: {
  202. type: String,
  203. default: '' },
  204. // 右侧图标
  205. rightIcon: {
  206. type: String,
  207. default: '' },
  208. // 左侧图标
  209. leftIcon: {
  210. type: String,
  211. default: '' },
  212. // 左侧图标的样式
  213. leftIconStyle: {
  214. type: Object,
  215. default: function _default() {
  216. return {};
  217. } },
  218. // 左侧图标的样式
  219. rightIconStyle: {
  220. type: Object,
  221. default: function _default() {
  222. return {};
  223. } },
  224. // 是否显示左边的必填星号,只作显示用,具体校验必填的逻辑,请在rules中配置
  225. required: {
  226. type: Boolean,
  227. default: false } },
  228. data: function data() {
  229. return {
  230. initialValue: '', // 存储的默认值
  231. // isRequired: false, // 是否必填,由于人性化考虑,必填"*"号通过props的required配置,不再通过rules的规则自动生成
  232. validateState: '', // 是否校验成功
  233. validateMessage: '', // 校验失败的提示语
  234. // 有错误时的提示方式,message-提示信息,border-如果input设置了边框,变成呈红色,
  235. errorType: ['message'],
  236. fieldValue: '', // 获取当前子组件input的输入的值
  237. // 父组件的参数,在computed计算中,无法得知this.parent发生变化,故将父组件的参数值,放到data中
  238. parentData: {
  239. borderBottom: true,
  240. labelWidth: 90,
  241. labelPosition: 'left',
  242. labelStyle: {},
  243. labelAlign: 'left' } };
  244. },
  245. watch: {
  246. validateState: function validateState(val) {
  247. this.broadcastInputError();
  248. },
  249. // 监听u-form组件的errorType的变化
  250. "uForm.errorType": function uFormErrorType(val) {
  251. this.errorType = val;
  252. this.broadcastInputError();
  253. } },
  254. computed: {
  255. // 计算后的label宽度,由于需要多个判断,故放到computed中
  256. uLabelWidth: function uLabelWidth() {
  257. // 如果用户设置label为空字符串(微信小程序空字符串最终会变成字符串的'true'),意味着要将label的位置宽度设置为auto
  258. return this.elLabelPosition == 'left' ? this.label === 'true' || this.label === '' ? 'auto' : this.$u.addUnit(this.
  259. elLabelWidth) : '100%';
  260. },
  261. showError: function showError() {var _this = this;
  262. return function (type) {
  263. // 如果errorType数组中含有none,或者toast提示类型
  264. if (_this.errorType.indexOf('none') >= 0) return false;else
  265. if (_this.errorType.indexOf(type) >= 0) return true;else
  266. return false;
  267. };
  268. },
  269. // label的宽度
  270. elLabelWidth: function elLabelWidth() {
  271. // label默认宽度为90,优先使用本组件的值,如果没有(如果设置为0,也算是配置了值,依然起效),则用u-form的值
  272. return this.labelWidth != 0 || this.labelWidth != '' ? this.labelWidth : this.parentData.labelWidth ? this.parentData.
  273. labelWidth :
  274. 90;
  275. },
  276. // label的样式
  277. elLabelStyle: function elLabelStyle() {
  278. return Object.keys(this.labelStyle).length ? this.labelStyle : this.parentData.labelStyle ? this.parentData.labelStyle :
  279. {};
  280. },
  281. // label的位置,左侧或者上方
  282. elLabelPosition: function elLabelPosition() {
  283. return this.labelPosition ? this.labelPosition : this.parentData.labelPosition ? this.parentData.labelPosition :
  284. 'left';
  285. },
  286. // label的对齐方式
  287. elLabelAlign: function elLabelAlign() {
  288. return this.labelAlign ? this.labelAlign : this.parentData.labelAlign ? this.parentData.labelAlign : 'left';
  289. },
  290. // label的下划线
  291. elBorderBottom: function elBorderBottom() {
  292. // 子组件的borderBottom默认为空字符串,如果不等于空字符串,意味着子组件设置了值,优先使用子组件的值
  293. return this.borderBottom !== '' ? this.borderBottom : this.parentData.borderBottom ? this.parentData.borderBottom :
  294. true;
  295. } },
  296. methods: {
  297. broadcastInputError: function broadcastInputError() {
  298. // 子组件发出事件,第三个参数为true或者false,true代表有错误
  299. this.broadcast('u-input', 'on-form-item-error', this.validateState === 'error' && this.showError('border'));
  300. },
  301. // 判断是否需要required校验
  302. setRules: function setRules() {
  303. var that = this;
  304. // 由于人性化考虑,必填"*"号通过props的required配置,不再通过rules的规则自动生成
  305. // 从父组件u-form拿到当前u-form-item需要验证 的规则
  306. // let rules = this.getRules();
  307. // if (rules.length) {
  308. // this.isRequired = rules.some(rule => {
  309. // // 如果有必填项,就返回,没有的话,就是undefined
  310. // return rule.required;
  311. // });
  312. // }
  313. // blur事件
  314. this.$on('on-form-blur', that.onFieldBlur);
  315. // change事件
  316. this.$on('on-form-change', that.onFieldChange);
  317. },
  318. // 从u-form的rules属性中,取出当前u-form-item的校验规则
  319. getRules: function getRules() {
  320. // 父组件的所有规则
  321. var rules = this.parent.rules;
  322. rules = rules ? rules[this.prop] : [];
  323. // 保证返回的是一个数组形式
  324. return [].concat(rules || []);
  325. },
  326. // blur事件时进行表单校验
  327. onFieldBlur: function onFieldBlur() {
  328. this.validation('blur');
  329. },
  330. // change事件进行表单校验
  331. onFieldChange: function onFieldChange() {
  332. this.validation('change');
  333. },
  334. // 过滤出符合要求的rule规则
  335. getFilteredRule: function getFilteredRule() {var triggerType = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
  336. var rules = this.getRules();
  337. // 整体验证表单时,triggerType为空字符串,此时返回所有规则进行验证
  338. if (!triggerType) return rules;
  339. // 历遍判断规则是否有对应的事件,比如blur,change触发等的事件
  340. // 使用indexOf判断,是因为某些时候设置的验证规则的trigger属性可能为多个,比如['blur','change']
  341. // 某些场景可能的判断规则,可能不存在trigger属性,故先判断是否存在此属性
  342. return rules.filter(function (res) {return res.trigger && res.trigger.indexOf(triggerType) !== -1;});
  343. },
  344. // 校验数据
  345. validation: function validation(trigger) {var _this2 = this;var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function () {};
  346. // 检验之间,先获取需要校验的值
  347. this.fieldValue = this.parent.model[this.prop];
  348. // blur和change是否有当前方式的校验规则
  349. var rules = this.getFilteredRule(trigger);
  350. // 判断是否有验证规则,如果没有规则,也调用回调方法,否则父组件u-form会因为
  351. // 对count变量的统计错误而无法进入上一层的回调
  352. if (!rules || rules.length === 0) {
  353. return callback('');
  354. }
  355. // 设置当前的装填,标识为校验中
  356. this.validateState = 'validating';
  357. // 调用async-validator的方法
  358. var validator = new _asyncValidator.default(_defineProperty({},
  359. this.prop, rules));
  360. validator.validate(_defineProperty({},
  361. this.prop, this.fieldValue),
  362. {
  363. firstFields: true },
  364. function (errors, fields) {
  365. // 记录状态和报错信息
  366. _this2.validateState = !errors ? 'success' : 'error';
  367. _this2.validateMessage = errors ? errors[0].message : '';
  368. // 调用回调方法
  369. callback(_this2.validateMessage);
  370. });
  371. },
  372. // 清空当前的u-form-item
  373. resetField: function resetField() {
  374. this.parent.model[this.prop] = this.initialValue;
  375. // 设置为`success`状态,只是为了清空错误标记
  376. this.validateState = 'success';
  377. } },
  378. // 组件创建完成时,将当前实例保存到u-form中
  379. mounted: function mounted() {var _this3 = this;
  380. // 支付宝、头条小程序不支持provide/inject,所以使用这个方法获取整个父组件,在created定义,避免循环应用
  381. this.parent = this.$u.$parent.call(this, 'u-form');
  382. if (this.parent) {
  383. // 历遍parentData中的属性,将parent中的同名属性赋值给parentData
  384. Object.keys(this.parentData).map(function (key) {
  385. _this3.parentData[key] = _this3.parent[key];
  386. });
  387. // 如果没有传入prop,或者uForm为空(如果u-form-input单独使用,就不会有uForm注入),就不进行校验
  388. if (this.prop) {
  389. // 将本实例添加到父组件中
  390. this.parent.fields.push(this);
  391. this.errorType = this.parent.errorType;
  392. // 设置初始值
  393. this.initialValue = this.fieldValue;
  394. // 添加表单校验,这里必须要写在$nextTick中,因为u-form的rules是通过ref手动传入的
  395. // 不在$nextTick中的话,可能会造成执行此处代码时,父组件还没通过ref把规则给u-form,导致规则为空
  396. this.$nextTick(function () {
  397. _this3.setRules();
  398. });
  399. }
  400. }
  401. },
  402. // 组件销毁前,将实例从u-form的缓存中移除
  403. beforeDestroy: function beforeDestroy() {var _this4 = this;
  404. // 如果当前没有prop的话表示当前不要进行删除(因为没有注入)
  405. if (this.parent && this.prop) {
  406. this.parent.fields.map(function (item, index) {
  407. if (item === _this4) _this4.parent.fields.splice(index, 1);
  408. });
  409. }
  410. } };exports.default = _default2;
  411. /***/ }),
  412. /***/ 327:
  413. /*!************************************************************************************************************************************************!*\
  414. !*** D:/星火篮球维护/代码/小程序销售端/spark-sale/uview-ui/components/u-form-item/u-form-item.vue?vue&type=style&index=0&id=006449ec&lang=scss&scoped=true& ***!
  415. \************************************************************************************************************************************************/
  416. /*! no static exports found */
  417. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  418. "use strict";
  419. __webpack_require__.r(__webpack_exports__);
  420. /* harmony import */ var _E_HBuilderX_plugins_uniapp_cli_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_E_HBuilderX_plugins_uniapp_cli_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_stylePostLoader_js_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_2_E_HBuilderX_plugins_uniapp_cli_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_3_E_HBuilderX_plugins_uniapp_cli_node_modules_sass_loader_dist_cjs_js_ref_8_oneOf_1_4_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_5_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_u_form_item_vue_vue_type_style_index_0_id_006449ec_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/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-form-item.vue?vue&type=style&index=0&id=006449ec&lang=scss&scoped=true& */ 328);
  421. /* harmony import */ var _E_HBuilderX_plugins_uniapp_cli_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_E_HBuilderX_plugins_uniapp_cli_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_stylePostLoader_js_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_2_E_HBuilderX_plugins_uniapp_cli_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_3_E_HBuilderX_plugins_uniapp_cli_node_modules_sass_loader_dist_cjs_js_ref_8_oneOf_1_4_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_5_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_u_form_item_vue_vue_type_style_index_0_id_006449ec_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_E_HBuilderX_plugins_uniapp_cli_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_E_HBuilderX_plugins_uniapp_cli_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_stylePostLoader_js_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_2_E_HBuilderX_plugins_uniapp_cli_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_3_E_HBuilderX_plugins_uniapp_cli_node_modules_sass_loader_dist_cjs_js_ref_8_oneOf_1_4_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_5_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_u_form_item_vue_vue_type_style_index_0_id_006449ec_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0__);
  422. /* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _E_HBuilderX_plugins_uniapp_cli_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_E_HBuilderX_plugins_uniapp_cli_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_stylePostLoader_js_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_2_E_HBuilderX_plugins_uniapp_cli_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_3_E_HBuilderX_plugins_uniapp_cli_node_modules_sass_loader_dist_cjs_js_ref_8_oneOf_1_4_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_5_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_u_form_item_vue_vue_type_style_index_0_id_006449ec_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _E_HBuilderX_plugins_uniapp_cli_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_E_HBuilderX_plugins_uniapp_cli_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_stylePostLoader_js_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_2_E_HBuilderX_plugins_uniapp_cli_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_3_E_HBuilderX_plugins_uniapp_cli_node_modules_sass_loader_dist_cjs_js_ref_8_oneOf_1_4_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_5_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_u_form_item_vue_vue_type_style_index_0_id_006449ec_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  423. /* harmony default export */ __webpack_exports__["default"] = (_E_HBuilderX_plugins_uniapp_cli_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_E_HBuilderX_plugins_uniapp_cli_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_stylePostLoader_js_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_2_E_HBuilderX_plugins_uniapp_cli_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_3_E_HBuilderX_plugins_uniapp_cli_node_modules_sass_loader_dist_cjs_js_ref_8_oneOf_1_4_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_5_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_E_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_u_form_item_vue_vue_type_style_index_0_id_006449ec_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0___default.a);
  424. /***/ }),
  425. /***/ 328:
  426. /*!**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  427. !*** ./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/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!D:/星火篮球维护/代码/小程序销售端/spark-sale/uview-ui/components/u-form-item/u-form-item.vue?vue&type=style&index=0&id=006449ec&lang=scss&scoped=true& ***!
  428. \**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  429. /*! no static exports found */
  430. /***/ (function(module, exports, __webpack_require__) {
  431. // extracted by mini-css-extract-plugin
  432. if(false) { var cssReload; }
  433. /***/ })
  434. }]);
  435. //# sourceMappingURL=../../../../.sourcemap/mp-weixin/uview-ui/components/u-form-item/u-form-item.js.map
  436. ;(global["webpackJsonp"] = global["webpackJsonp"] || []).push([
  437. 'uview-ui/components/u-form-item/u-form-item-create-component',
  438. {
  439. 'uview-ui/components/u-form-item/u-form-item-create-component':(function(module, exports, __webpack_require__){
  440. __webpack_require__('1')['createComponent'](__webpack_require__(319))
  441. })
  442. },
  443. [['uview-ui/components/u-form-item/u-form-item-create-component']]
  444. ]);