u-input.js.map
26.8 KB
{"version":3,"sources":["webpack:///D:/vue/kaoshi3-fangweishangcheng/node_modules/uview-ui/components/u-input/u-input.vue?fea0","webpack:///D:/vue/kaoshi3-fangweishangcheng/node_modules/uview-ui/components/u-input/u-input.vue?595d","webpack:///D:/vue/kaoshi3-fangweishangcheng/node_modules/uview-ui/components/u-input/u-input.vue?5fe8","webpack:///D:/vue/kaoshi3-fangweishangcheng/node_modules/uview-ui/components/u-input/u-input.vue?ce04","uni-app:///node_modules/uview-ui/components/u-input/u-input.vue","webpack:///D:/vue/kaoshi3-fangweishangcheng/node_modules/uview-ui/components/u-input/u-input.vue?e9be","webpack:///D:/vue/kaoshi3-fangweishangcheng/node_modules/uview-ui/components/u-input/u-input.vue?0925"],"names":[],"mappings":";;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAgI;AAChI;AAC2D;AACL;AACsC;;;AAG5F;AACgL;AAChL,gBAAgB,6KAAU;AAC1B,EAAE,6EAAM;AACR,EAAE,8FAAM;AACR,EAAE,uGAAe;AACjB;AACA;AACA;AACA;AACA;AACA,EAAE,kGAAU;AACZ;AACA;;AAEA;AACe,gF;;;;;;;;;;;;ACvBf;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;;;;;;;;;;;ACAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA,aAAa,qRAEN;AACP;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;AC9CA;AAAA;AAAA;AAAA;AAAqqB,CAAgB,inBAAG,EAAC,C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC4EzrB,gF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBA0CA,EACA,eADA,EAEA,sDAFA,EAGA,IAHA,kBAGA,CACA,SACA;AACA,oBAFA,EAGA;AACA,oBAJA,EAKA;AACA,uBANA,EAOA;AACA,4BARA,EASA;AACA,oEAVA,GAYA,CAhBA,EAiBA,SACA,SACA,eADA,EAEA,OAFA,mBAEA,MAFA,EAEA,MAFA,EAEA,CACA,yBAUA,yBAXA,CAYA;AACA,qCACA,CAhBA,EADA,EAjBA,EAqCA,YACA;AACA,eAFA,yBAEA,KACA,SADA,GACA,IADA,CACA,SADA,CACA,QADA,GACA,IADA,CACA,QADA,CACA,OADA,GACA,IADA,CACA,OADA,CACA,UADA,GACA,IADA,CACA,UADA,CAEA,kEACA,CALA,EAMA;AACA,cAPA,wBAOA,CACA,iBACA,MADA,GACA,IADA,CACA,MADA,CACA,QADA,GACA,IADA,CACA,QADA,CACA,KADA,GACA,IADA,CACA,KADA,CAEA,0BACA,yDADA,EAEA,wCACA,wBACA,0BACA,iBADA,EAEA,oBAFA,EADA,EAKA,yBACA,CAnBA,EAoBA;AACA,gBArBA,0BAqBA,CACA,eADA,CAEA;AACA,0BACA,2CACA,CALA,CAMA;AACA,mCACA,oBACA,CAFA,MAEA,CACA;AACA,iCACA,4BACA,0BACA,2BACA,CACA,kEACA,CAtCA,EAuCA;AACA,cAxCA,wBAwCA,CACA,cACA,iBADA,EAEA,uCAFA,EAGA,0BAHA,GAKA,aACA,CA/CA,EArCA,EAsFA;AACA;AACA,gBAFA,wBAEA,CAFA,EAEA;AACA;AACA,KAJA;AAKA;AACA,WANA,mBAMA,CANA,EAMA;AACA,oBADA,mBACA,KADA,CACA,KADA,2BACA,EADA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAHA;AAIA,KAjBA;AAkBA;AACA,UAnBA,kBAmBA,KAnBA,EAmBA;AACA;AACA;AACA;AACA;AACA;AACA,OAFA;AAGA;AACA;AACA,KA5BA;AA6BA;AACA,WA9BA,mBA8BA,KA9BA,EA8BA;AACA;AACA;AACA,KAjCA;AAkCA;AACA,aAnCA,qBAmCA,KAnCA,EAmCA;AACA;AACA,KArCA;AAsCA;AACA;AACA,0BAxCA,oCAwCA;AACA;AACA,KA1CA;AA2CA;AACA,eA5CA,yBA4CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAPA;AAQA,KAtDA;AAuDA;AACA,WAxDA,qBAwDA;AACA;AACA;AACA;AACA;AACA,OAHA;AAIA,KA9DA;AA+DA;;;;;AAKA,gBApEA,0BAoEA;;;;;;;;;AASA,KA7EA,EAtFA,E;;;;;;;;;;;;;ACvHA;AAAA;AAAA;AAAA;AAA4xC,CAAgB,wnCAAG,EAAC,C;;;;;;;;;;;ACAhzC;AACA,OAAO,KAAU,EAAE,kBAKd","file":"node-modules/uview-ui/components/u-input/u-input.js","sourcesContent":["import { render, staticRenderFns, recyclableRender, components } from \"./u-input.vue?vue&type=template&id=fdbb9fe6&scoped=true&\"\nvar renderjs\nimport script from \"./u-input.vue?vue&type=script&lang=js&\"\nexport * from \"./u-input.vue?vue&type=script&lang=js&\"\nimport style0 from \"./u-input.vue?vue&type=style&index=0&id=fdbb9fe6&lang=scss&scoped=true&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../../../高级前台制作/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"fdbb9fe6\",\n null,\n false,\n components,\n renderjs\n)\n\ncomponent.options.__file = \"node_modules/uview-ui/components/u-input/u-input.vue\"\nexport default component.exports","export * from \"-!../../../../../../高级前台制作/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../../../../高级前台制作/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--16-0!../../../../../../高级前台制作/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/template.js!../../../../../../高级前台制作/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-uni-app-loader/page-meta.js!../../../../../../高级前台制作/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/index.js??vue-loader-options!../../../../../../高级前台制作/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./u-input.vue?vue&type=template&id=fdbb9fe6&scoped=true&\"","var components\ntry {\n components = {\n uIcon: function() {\n return import(\n /* webpackChunkName: \"node-modules/uview-ui/components/u-icon/u-icon\" */ \"uview-ui/components/u-icon/u-icon.vue\"\n )\n }\n }\n} catch (e) {\n if (\n e.message.indexOf(\"Cannot find module\") !== -1 &&\n e.message.indexOf(\".vue\") !== -1\n ) {\n console.error(e.message)\n console.error(\"1. 排查组件名称拼写是否正确\")\n console.error(\n \"2. 排查组件是否符合 easycom 规范,文档:https://uniapp.dcloud.net.cn/collocation/pages?id=easycom\"\n )\n console.error(\n \"3. 若组件不符合 easycom 规范,需手动引入,并在 components 中注册该组件\"\n )\n } else {\n throw e\n }\n}\nvar render = function() {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n var s0 = _vm.__get_style([_vm.wrapperStyle])\n\n var s1 = _vm.__get_style([_vm.inputStyle])\n\n _vm.$mp.data = Object.assign(\n {},\n {\n $root: {\n s0: s0,\n s1: s1\n }\n }\n )\n}\nvar recyclableRender = false\nvar staticRenderFns = []\nrender._withStripped = true\n\nexport { render, staticRenderFns, recyclableRender, components }","import mod from \"-!../../../../../../高级前台制作/HBuilderX/plugins/uniapp-cli/node_modules/babel-loader/lib/index.js!../../../../../../高级前台制作/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--12-1!../../../../../../高级前台制作/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/script.js!../../../../../../高级前台制作/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/index.js??vue-loader-options!../../../../../../高级前台制作/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./u-input.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../../../高级前台制作/HBuilderX/plugins/uniapp-cli/node_modules/babel-loader/lib/index.js!../../../../../../高级前台制作/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--12-1!../../../../../../高级前台制作/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/script.js!../../../../../../高级前台制作/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/index.js??vue-loader-options!../../../../../../高级前台制作/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./u-input.vue?vue&type=script&lang=js&\"","<template>\r\n <view class=\"u-input\" :class=\"inputClass\" :style=\"[wrapperStyle]\">\r\n <view class=\"u-input__content\">\r\n <view\r\n class=\"u-input__content__prefix-icon\"\r\n v-if=\"prefixIcon || $slots.prefix\"\r\n >\r\n <slot name=\"prefix\">\r\n <u-icon\r\n :name=\"prefixIcon\"\r\n size=\"18\"\r\n :customStyle=\"prefixIconStyle\"\r\n ></u-icon>\r\n </slot>\r\n </view>\r\n <view class=\"u-input__content__field-wrapper\" @tap=\"clickHandler\">\r\n\t\t\t\t<!-- 根据uni-app的input组件文档,H5和APP中只要声明了password参数(无论true还是false),type均失效,此时\r\n\t\t\t\t\t为了防止type=number时,又存在password属性,type无效,此时需要设置password为undefined\r\n\t\t\t\t -->\r\n \t<input\r\n \t class=\"u-input__content__field-wrapper__field\"\r\n \t :style=\"[inputStyle]\"\r\n \t :type=\"type\"\r\n \t :focus=\"focus\"\r\n \t :cursor=\"cursor\"\r\n \t :value=\"innerValue\"\r\n \t :auto-blur=\"autoBlur\"\r\n \t :disabled=\"disabled || readonly\"\r\n \t :maxlength=\"maxlength\"\r\n \t :placeholder=\"placeholder\"\r\n \t :placeholder-style=\"placeholderStyle\"\r\n \t :placeholder-class=\"placeholderClass\"\r\n \t :confirm-type=\"confirmType\"\r\n \t :confirm-hold=\"confirmHold\"\r\n \t :hold-keyboard=\"holdKeyboard\"\r\n \t :cursor-spacing=\"cursorSpacing\"\r\n \t :adjust-position=\"adjustPosition\"\r\n \t :selection-end=\"selectionEnd\"\r\n \t :selection-start=\"selectionStart\"\r\n \t :password=\"password || type === 'password' || undefined\"\r\n \t @input=\"onInput\"\r\n \t @blur=\"onBlur\"\r\n \t @focus=\"onFocus\"\r\n \t @confirm=\"onConfirm\"\r\n \t @keyboardheightchange=\"onkeyboardheightchange\"\r\n \t/>\r\n </view>\r\n <view\r\n class=\"u-input__content__clear\"\r\n v-if=\"isShowClear\"\r\n @tap=\"onClear\"\r\n >\r\n <u-icon\r\n name=\"close\"\r\n size=\"11\"\r\n color=\"#ffffff\"\r\n customStyle=\"line-height: 12px\"\r\n ></u-icon>\r\n </view>\r\n <view\r\n class=\"u-input__content__subfix-icon\"\r\n v-if=\"suffixIcon || $slots.suffix\"\r\n >\r\n <slot name=\"suffix\">\r\n <u-icon\r\n :name=\"suffixIcon\"\r\n size=\"18\"\r\n :customStyle=\"suffixIconStyle\"\r\n ></u-icon>\r\n </slot>\r\n </view>\r\n </view>\r\n </view>\r\n</template>\r\n\r\n<script>\r\nimport props from \"./props.js\";\r\n/**\r\n * Input 输入框\r\n * @description 此组件为一个输入框,默认没有边框和样式,是专门为配合表单组件u-form而设计的,利用它可以快速实现表单验证,输入内容,下拉选择等功能。\r\n * @tutorial https://uviewui.com/components/input.html\r\n * @property {String | Number}\tvalue\t\t\t\t\t输入的值\r\n * @property {String}\t\t\ttype\t\t\t\t\t输入框类型,见上方说明 ( 默认 'text' )\r\n * @property {Boolean}\t\t\tfixed\t\t\t\t\t如果 textarea 是在一个 position:fixed 的区域,需要显示指定属性 fixed 为 true,兼容性:微信小程序、百度小程序、字节跳动小程序、QQ小程序 ( 默认 false )\r\n * @property {Boolean}\t\t\tdisabled\t\t\t\t是否禁用输入框 ( 默认 false )\r\n * @property {String}\t\t\tdisabledColor\t\t\t禁用状态时的背景色( 默认 '#f5f7fa' )\r\n * @property {Boolean}\t\t\tclearable\t\t\t\t是否显示清除控件 ( 默认 false )\r\n * @property {Boolean}\t\t\tpassword\t\t\t\t是否密码类型 ( 默认 false )\r\n * @property {String | Number}\tmaxlength\t\t\t\t最大输入长度,设置为 -1 的时候不限制最大长度 ( 默认 -1 )\r\n * @property {String}\t\t\tplaceholder\t\t\t\t输入框为空时的占位符\r\n * @property {String}\t\t\tplaceholderClass\t\t指定placeholder的样式类,注意页面或组件的style中写了scoped时,需要在类名前写/deep/ ( 默认 'input-placeholder' )\r\n * @property {String | Object}\tplaceholderStyle\t\t指定placeholder的样式,字符串/对象形式,如\"color: red;\"\r\n * @property {Boolean}\t\t\tshowWordLimit\t\t\t是否显示输入字数统计,只在 type =\"text\"或type =\"textarea\"时有效 ( 默认 false )\r\n * @property {String}\t\t\tconfirmType\t\t\t\t设置右下角按钮的文字,兼容性详见uni-app文档 ( 默认 'done' )\r\n * @property {Boolean}\t\t\tconfirmHold\t\t\t\t点击键盘右下角按钮时是否保持键盘不收起,H5无效 ( 默认 false )\r\n * @property {Boolean}\t\t\tholdKeyboard\t\t\tfocus时,点击页面的时候不收起键盘,微信小程序有效 ( 默认 false )\r\n * @property {Boolean}\t\t\tfocus\t\t\t\t\t自动获取焦点,在 H5 平台能否聚焦以及软键盘是否跟随弹出,取决于当前浏览器本身的实现。nvue 页面不支持,需使用组件的 focus()、blur() 方法控制焦点 ( 默认 false )\r\n * @property {Boolean}\t\t\tautoBlur\t\t\t\t键盘收起时,是否自动失去焦点,目前仅App3.0.0+有效 ( 默认 false )\r\n * @property {Boolean}\t\t\tdisableDefaultPadding\t是否去掉 iOS 下的默认内边距,仅微信小程序,且type=textarea时有效 ( 默认 false )\r\n * @property {String | Number}\tcursor\t\t\t\t\t指定focus时光标的位置( 默认 -1 )\r\n * @property {String | Number}\tcursorSpacing\t\t\t输入框聚焦时底部与键盘的距离 ( 默认 30 )\r\n * @property {String | Number}\tselectionStart\t\t\t光标起始位置,自动聚集时有效,需与selection-end搭配使用 ( 默认 -1 )\r\n * @property {String | Number}\tselectionEnd\t\t\t光标结束位置,自动聚集时有效,需与selection-start搭配使用 ( 默认 -1 )\r\n * @property {Boolean}\t\t\tadjustPosition\t\t\t键盘弹起时,是否自动上推页面 ( 默认 true )\r\n * @property {String}\t\t\tinputAlign\t\t\t\t输入框内容对齐方式( 默认 'left' )\r\n * @property {String | Number}\tfontSize\t\t\t\t输入框字体的大小 ( 默认 '15px' )\r\n * @property {String}\t\t\tcolor\t\t\t\t\t输入框字体颜色\t( 默认 '#303133' )\r\n * @property {Function}\t\t\tformatter\t\t\t 内容式化函数\r\n * @property {String}\t\t\tprefixIcon\t\t\t\t输入框前置图标\r\n * @property {String | Object}\tprefixIconStyle\t\t\t前置图标样式,对象或字符串\r\n * @property {String}\t\t\tsuffixIcon\t\t\t\t输入框后置图标\r\n * @property {String | Object}\tsuffixIconStyle\t\t\t后置图标样式,对象或字符串\r\n * @property {String}\t\t\tborder\t\t\t\t\t边框类型,surround-四周边框,bottom-底部边框,none-无边框 ( 默认 'surround' )\r\n * @property {Boolean}\t\t\treadonly\t\t\t\t是否只读,与disabled不同之处在于disabled会置灰组件,而readonly则不会 ( 默认 false )\r\n * @property {String}\t\t\tshape\t\t\t\t\t输入框形状,circle-圆形,square-方形 ( 默认 'square' )\r\n * @property {Object}\t\t\tcustomStyle\t\t\t\t定义需要用到的外部样式\r\n *\r\n * @example <u-input v-model=\"value\" :password=\"true\" suffix-icon=\"lock-fill\" />\r\n */\r\nexport default {\r\n name: \"u-input\",\r\n mixins: [uni.$u.mpMixin, uni.$u.mixin, props],\r\n data() {\r\n return {\r\n // 输入框的值\r\n innerValue: \"\",\r\n // 是否处于获得焦点状态\r\n focused: false,\r\n // value是否第一次变化,在watch中,由于加入immediate属性,会在第一次触发,此时不应该认为value发生了变化\r\n firstChange: true,\r\n // value绑定值的变化是由内部还是外部引起的\r\n changeFromInner: false,\r\n\t\t\t// 过滤处理方法\r\n\t\t\tinnerFormatter: value => value\r\n };\r\n },\r\n watch: {\r\n value: {\r\n immediate: true,\r\n handler(newVal, oldVal) {\r\n this.innerValue = newVal;\r\n /* #ifdef H5 */\r\n // 在H5中,外部value变化后,修改input中的值,不会触发@input事件,此时手动调用值变化方法\r\n if (\r\n this.firstChange === false &&\r\n this.changeFromInner === false\r\n ) {\r\n this.valueChange();\r\n }\r\n /* #endif */\r\n this.firstChange = false;\r\n // 重置changeFromInner的值为false,标识下一次引起默认为外部引起的\r\n this.changeFromInner = false;\r\n },\r\n },\r\n },\r\n computed: {\r\n // 是否显示清除控件\r\n isShowClear() {\r\n const { clearable, readonly, focused, innerValue } = this;\r\n return !!clearable && !readonly && !!focused && innerValue !== \"\";\r\n },\r\n // 组件的类名\r\n inputClass() {\r\n let classes = [],\r\n { border, disabled, shape } = this;\r\n border === \"surround\" &&\r\n (classes = classes.concat([\"u-border\", \"u-input--radius\"]));\r\n classes.push(`u-input--${shape}`);\r\n border === \"bottom\" &&\r\n (classes = classes.concat([\r\n \"u-border-bottom\",\r\n \"u-input--no-radius\",\r\n ]));\r\n return classes.join(\" \");\r\n },\r\n // 组件的样式\r\n wrapperStyle() {\r\n const style = {};\r\n // 禁用状态下,被背景色加上对应的样式\r\n if (this.disabled) {\r\n style.backgroundColor = this.disabledColor;\r\n }\r\n // 无边框时,去除内边距\r\n if (this.border === \"none\") {\r\n style.padding = \"0\";\r\n } else {\r\n // 由于uni-app的iOS开发者能力有限,导致需要分开写才有效\r\n style.paddingTop = \"6px\";\r\n style.paddingBottom = \"6px\";\r\n style.paddingLeft = \"9px\";\r\n style.paddingRight = \"9px\";\r\n }\r\n return uni.$u.deepMerge(style, uni.$u.addStyle(this.customStyle));\r\n },\r\n // 输入框的样式\r\n inputStyle() {\r\n const style = {\r\n color: this.color,\r\n fontSize: uni.$u.addUnit(this.fontSize),\r\n\t\t\t\ttextAlign: this.inputAlign\r\n };\r\n return style;\r\n },\r\n },\r\n methods: {\r\n\t\t// 在微信小程序中,不支持将函数当做props参数,故只能通过ref形式调用\r\n\t\tsetFormatter(e) {\r\n\t\t\tthis.innerFormatter = e\r\n\t\t},\r\n // 当键盘输入时,触发input事件\r\n onInput(e) {\r\n let { value = \"\" } = e.detail || {};\r\n // 格式化过滤方法\r\n const formatter = this.formatter || this.innerFormatter\r\n const formatValue = formatter(value)\r\n // 为了避免props的单向数据流特性,需要先将innerValue值设置为当前值,再在$nextTick中重新赋予设置后的值才有效\r\n this.innerValue = value\r\n this.$nextTick(() => {\r\n \tthis.innerValue = formatValue;\r\n \tthis.valueChange();\r\n })\r\n },\r\n // 输入框失去焦点时触发\r\n onBlur(event) {\r\n this.$emit(\"blur\", event.detail.value);\r\n // H5端的blur会先于点击清除控件的点击click事件触发,导致focused\r\n // 瞬间为false,从而隐藏了清除控件而无法被点击到\r\n uni.$u.sleep(50).then(() => {\r\n this.focused = false;\r\n });\r\n // 尝试调用u-form的验证方法\r\n uni.$u.formValidate(this, \"blur\");\r\n },\r\n // 输入框聚焦时触发\r\n onFocus(event) {\r\n this.focused = true;\r\n this.$emit(\"focus\");\r\n },\r\n // 点击完成按钮时触发\r\n onConfirm(event) {\r\n this.$emit(\"confirm\", this.innerValue);\r\n },\r\n // 键盘高度发生变化的时候触发此事件\r\n // 兼容性:微信小程序2.7.0+、App 3.1.0+\r\n\t\tonkeyboardheightchange() {\r\n this.$emit(\"keyboardheightchange\");\r\n },\r\n // 内容发生变化,进行处理\r\n valueChange() {\r\n const value = this.innerValue;\r\n this.$nextTick(() => {\r\n this.$emit(\"input\", value);\r\n // 标识value值的变化是由内部引起的\r\n this.changeFromInner = true;\r\n this.$emit(\"change\", value);\r\n // 尝试调用u-form的验证方法\r\n uni.$u.formValidate(this, \"change\");\r\n });\r\n },\r\n // 点击清除控件\r\n onClear() {\r\n this.innerValue = \"\";\r\n this.$nextTick(() => {\r\n this.valueChange();\r\n this.$emit(\"clear\");\r\n });\r\n },\r\n /**\r\n * 在安卓nvue上,事件无法冒泡\r\n * 在某些时间,我们希望监听u-from-item的点击事件,此时会导致点击u-form-item内的u-input后\r\n * 无法触发u-form-item的点击事件,这里通过手动调用u-form-item的方法进行触发\r\n */\r\n clickHandler() {\r\n // #ifdef APP-NVUE\r\n if (uni.$u.os() === \"android\") {\r\n const formItem = uni.$u.$parent.call(this, \"u-form-item\");\r\n if (formItem) {\r\n formItem.clickHandler();\r\n }\r\n }\r\n // #endif\r\n },\r\n },\r\n};\r\n</script>\r\n\r\n<style lang=\"scss\" scoped>\r\n@import \"../../libs/css/components.scss\";\r\n\r\n.u-input {\r\n @include flex(row);\r\n align-items: center;\r\n justify-content: space-between;\r\n flex: 1;\r\n\r\n &--radius,\r\n &--square {\r\n border-radius: 4px;\r\n }\r\n\r\n &--no-radius {\r\n border-radius: 0;\r\n }\r\n\r\n &--circle {\r\n border-radius: 100px;\r\n }\r\n\r\n &__content {\r\n flex: 1;\r\n @include flex(row);\r\n align-items: center;\r\n justify-content: space-between;\r\n\r\n &__field-wrapper {\r\n position: relative;\r\n @include flex(row);\r\n margin: 0;\r\n flex: 1;\r\n\t\t\t\r\n\t\t\t&__field {\r\n\t\t\t\tline-height: 26px;\r\n\t\t\t\ttext-align: left;\r\n\t\t\t\tcolor: $u-main-color;\r\n\t\t\t\theight: 24px;\r\n\t\t\t\tfont-size: 15px;\r\n\t\t\t\tflex: 1;\r\n\t\t\t}\r\n }\r\n\r\n &__clear {\r\n width: 20px;\r\n height: 20px;\r\n border-radius: 100px;\r\n background-color: #c6c7cb;\r\n @include flex(row);\r\n align-items: center;\r\n justify-content: center;\r\n transform: scale(0.82);\r\n margin-left: 4px;\r\n }\r\n\r\n &__subfix-icon {\r\n margin-left: 4px;\r\n }\r\n\r\n &__prefix-icon {\r\n margin-right: 4px;\r\n }\r\n }\r\n}\r\n</style>\r\n","import mod from \"-!../../../../../../高级前台制作/HBuilderX/plugins/uniapp-cli/node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../../../../高级前台制作/HBuilderX/plugins/uniapp-cli/node_modules/css-loader/dist/cjs.js??ref--8-oneOf-1-1!../../../../../../高级前台制作/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/stylePostLoader.js!../../../../../../高级前台制作/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--8-oneOf-1-2!../../../../../../高级前台制作/HBuilderX/plugins/uniapp-cli/node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-3!../../../../../../高级前台制作/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/sass-loader/dist/cjs.js??ref--8-oneOf-1-4!../../../../../../高级前台制作/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--8-oneOf-1-5!../../../../../../高级前台制作/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/index.js??vue-loader-options!../../../../../../高级前台制作/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./u-input.vue?vue&type=style&index=0&id=fdbb9fe6&lang=scss&scoped=true&\"; export default mod; export * from \"-!../../../../../../高级前台制作/HBuilderX/plugins/uniapp-cli/node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../../../../高级前台制作/HBuilderX/plugins/uniapp-cli/node_modules/css-loader/dist/cjs.js??ref--8-oneOf-1-1!../../../../../../高级前台制作/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/stylePostLoader.js!../../../../../../高级前台制作/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--8-oneOf-1-2!../../../../../../高级前台制作/HBuilderX/plugins/uniapp-cli/node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-3!../../../../../../高级前台制作/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/sass-loader/dist/cjs.js??ref--8-oneOf-1-4!../../../../../../高级前台制作/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--8-oneOf-1-5!../../../../../../高级前台制作/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/index.js??vue-loader-options!../../../../../../高级前台制作/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./u-input.vue?vue&type=style&index=0&id=fdbb9fe6&lang=scss&scoped=true&\"","// extracted by mini-css-extract-plugin\n if(module.hot) {\n // 1670310492334\n var cssReload = require(\"D:/高级前台制作/HBuilderX/plugins/uniapp-cli/node_modules/mini-css-extract-plugin/dist/hmr/hotModuleReplacement.js\")(module.id, {\"hmr\":true,\"publicPath\":\"../../\",\"locals\":false});\n module.hot.dispose(cssReload);\n module.hot.accept(undefined, cssReload);\n }\n "],"sourceRoot":""}