u-textarea.js.map 19.4 KB
{"version":3,"sources":["webpack:///D:/vue/kaoshi3/node_modules/uview-ui/components/u-textarea/u-textarea.vue?483b","webpack:///D:/vue/kaoshi3/node_modules/uview-ui/components/u-textarea/u-textarea.vue?f3ba","webpack:///D:/vue/kaoshi3/node_modules/uview-ui/components/u-textarea/u-textarea.vue?63e3","webpack:///D:/vue/kaoshi3/node_modules/uview-ui/components/u-textarea/u-textarea.vue?86c0","uni-app:///node_modules/uview-ui/components/u-textarea/u-textarea.vue","webpack:///D:/vue/kaoshi3/node_modules/uview-ui/components/u-textarea/u-textarea.vue?17c2","webpack:///D:/vue/kaoshi3/node_modules/uview-ui/components/u-textarea/u-textarea.vue?dbfb"],"names":[],"mappings":";;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAmI;AACnI;AAC8D;AACL;AACsC;;;AAG/F;AACgL;AAChL,gBAAgB,6KAAU;AAC1B,EAAE,gFAAM;AACR,EAAE,iGAAM;AACR,EAAE,0GAAe;AACjB;AACA;AACA;AACA;AACA;AACA,EAAE,qGAAU;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;AACA;;AAEA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;ACtBA;AAAA;AAAA;AAAA;AAAwqB,CAAgB,onBAAG,EAAC,C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC0C5rB,gF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAoCA,EACA,kBADA,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,iBAFA,2BAEA,CACA,iBACA,MADA,GACA,IADA,CACA,MADA,CACA,QADA,GACA,IADA,CACA,QADA,CACA,KADA,GACA,IADA,CACA,KADA,CAEA,0BACA,4DADA,EAEA,wBACA,0BACA,iBADA;AAEA,6BAFA,EADA;;AAKA;AACA;AACA,KAdA;AAeA;AACA,iBAhBA,2BAgBA;AACA;;;;;;;;;;AAUA;AACA,KA5BA,EArCA;;AAmEA;AACA;AACA,gBAFA,wBAEA,CAFA,EAEA;AACA;AACA,KAJA;AAKA,WALA,mBAKA,CALA,EAKA;AACA;AACA,KAPA;AAQA,UARA,kBAQA,CARA,EAQA;AACA;AACA;AACA;AACA,KAZA;AAaA,gBAbA,wBAaA,CAbA,EAaA;AACA;AACA,KAfA;AAgBA,WAhBA,mBAgBA,CAhBA,EAgBA;AACA,oBADA,mBACA,KADA,CACA,KADA,2BACA,EADA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAHA;AAIA,KA3BA;AA4BA;AACA,eA7BA,yBA6BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAPA;AAQA,KAvCA;AAwCA,aAxCA,qBAwCA,CAxCA,EAwCA;AACA;AACA,KA1CA;AA2CA,0BA3CA,kCA2CA,CA3CA,EA2CA;AACA;AACA,KA7CA,EAnEA,E;;;;;;;;;;;;;AC/EA;AAAA;AAAA;AAAA;AAA+xC,CAAgB,2nCAAG,EAAC,C;;;;;;;;;;;ACAnzC;AACA,OAAO,KAAU,EAAE,kBAKd","file":"node-modules/uview-ui/components/u-textarea/u-textarea.js","sourcesContent":["import { render, staticRenderFns, recyclableRender, components } from \"./u-textarea.vue?vue&type=template&id=81cd9d32&scoped=true&\"\nvar renderjs\nimport script from \"./u-textarea.vue?vue&type=script&lang=js&\"\nexport * from \"./u-textarea.vue?vue&type=script&lang=js&\"\nimport style0 from \"./u-textarea.vue?vue&type=style&index=0&id=81cd9d32&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  \"81cd9d32\",\n  null,\n  false,\n  components,\n  renderjs\n)\n\ncomponent.options.__file = \"node_modules/uview-ui/components/u-textarea/u-textarea.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-textarea.vue?vue&type=template&id=81cd9d32&scoped=true&\"","var components\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.textareaStyle])\n\n  var g0 = _vm.$u.addUnit(_vm.height)\n  var g1 = _vm.$u.addStyle(_vm.placeholderStyle, \"string\")\n  _vm.$mp.data = Object.assign(\n    {},\n    {\n      $root: {\n        s0: s0,\n        g0: g0,\n        g1: g1\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-textarea.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-textarea.vue?vue&type=script&lang=js&\"","<template>\n    <view class=\"u-textarea\" :class=\"textareaClass\" :style=\"[textareaStyle]\">\n        <textarea\n            class=\"u-textarea__field\"\n            :value=\"innerValue\"\n            :style=\"{ height: $u.addUnit(height) }\"\n            :placeholder=\"placeholder\"\n            :placeholder-style=\"$u.addStyle(placeholderStyle, 'string')\"\n            :placeholder-class=\"placeholderClass\"\n            :disabled=\"disabled\"\n            :focus=\"focus\"\n            :autoHeight=\"autoHeight\"\n            :fixed=\"fixed\"\n            :cursorSpacing=\"cursorSpacing\"\n            :cursor=\"cursor\"\n            :showConfirmBar=\"showConfirmBar\"\n            :selectionStart=\"selectionStart\"\n            :selectionEnd=\"selectionEnd\"\n            :adjustPosition=\"adjustPosition\"\n            :disableDefaultPadding=\"disableDefaultPadding\"\n            :holdKeyboard=\"holdKeyboard\"\n            :maxlength=\"maxlength\"\n            :confirmType=\"confirmType\"\n            @focus=\"onFocus\"\n            @blur=\"onBlur\"\n            @linechange=\"onLinechange\"\n            @input=\"onInput\"\n            @confirm=\"onConfirm\"\n            @keyboardheightchange=\"onKeyboardheightchange\"\n        ></textarea>\n        <text\n            class=\"u-textarea__count\"\n            :style=\"{\n                'background-color': disabled ? 'transparent' : '#fff',\n            }\"\n            v-if=\"count\"\n            >{{ innerValue.length }}/{{ maxlength }}</text\n        >\n    </view>\n</template>\n\n<script>\nimport props from \"./props.js\";\n/**\n * Textarea 文本域\n * @description 文本域此组件满足了可能出现的表单信息补充,编辑等实际逻辑的功能,内置了字数校验等\n * @tutorial https://www.uviewui.com/components/textarea.html\n *\n * @property {String | Number} \t\tvalue\t\t\t\t\t输入框的内容\n * @property {String | Number}\t\tplaceholder\t\t\t\t输入框为空时占位符\n * @property {String}\t\t\t    placeholderClass\t\t指定placeholder的样式类,注意页面或组件的style中写了scoped时,需要在类名前写/deep/ ( 默认 'input-placeholder' )\n * @property {String | Object}\t    placeholderStyle\t\t指定placeholder的样式,字符串/对象形式,如\"color: red;\"\n * @property {String | Number}\t\theight\t\t\t\t\t输入框高度(默认 70 )\n * @property {String}\t\t\t\tconfirmType\t\t\t\t设置键盘右下角按钮的文字,仅微信小程序,App-vue和H5有效(默认 'done' )\n * @property {Boolean}\t\t\t\tdisabled\t\t\t\t是否禁用(默认 false )\n * @property {Boolean}\t\t\t\tcount\t\t\t\t\t是否显示统计字数(默认 false )\n * @property {Boolean}\t\t\t\tfocus\t\t\t\t\t是否自动获取焦点,nvue不支持,H5取决于浏览器的实现(默认 false )\n * @property {Boolean | Function}\tautoHeight\t\t\t\t是否自动增加高度(默认 false )\n * @property {Boolean}\t\t\t\tfixed\t\t\t\t\t如果textarea是在一个position:fixed的区域,需要显示指定属性fixed为true(默认 false )\n * @property {Number}\t\t\t\tcursorSpacing\t\t\t指定光标与键盘的距离(默认 0 )\n * @property {String | Number}\t\tcursor\t\t\t\t\t指定focus时的光标位置\n * @property {Function}\t\t\t    formatter\t\t\t    内容式化函数\n * @property {Boolean}\t\t\t\tshowConfirmBar\t\t\t是否显示键盘上方带有”完成“按钮那一栏,(默认 true )\n * @property {Number}\t\t\t\tselectionStart\t\t\t光标起始位置,自动聚焦时有效,需与selection-end搭配使用,(默认 -1 )\n * @property {Number | Number}\t\tselectionEnd\t\t\t光标结束位置,自动聚焦时有效,需与selection-start搭配使用(默认 -1 )\n * @property {Boolean}\t\t\t\tadjustPosition\t\t\t键盘弹起时,是否自动上推页面(默认 true )\n * @property {Boolean | Number}\t\tdisableDefaultPadding\t是否去掉 iOS 下的默认内边距,只微信小程序有效(默认 false )\n * @property {Boolean}\t\t\t\tholdKeyboard\t\t\tfocus时,点击页面的时候不收起键盘,只微信小程序有效(默认 false )\n * @property {String | Number}\t\tmaxlength\t\t\t\t最大输入长度,设置为 -1 的时候不限制最大长度(默认 140 )\n * @property {String}\t\t\t\tborder\t\t\t\t\t边框类型,surround-四周边框,none-无边框,bottom-底部边框(默认 'surround' )\n *\n * @event {Function(e)} focus\t\t\t\t\t输入框聚焦时触发,event.detail = { value, height },height 为键盘高度\n * @event {Function(e)} blur\t\t\t\t\t输入框失去焦点时触发,event.detail = {value, cursor}\n * @event {Function(e)} linechange\t\t\t\t输入框行数变化时调用,event.detail = {height: 0, heightRpx: 0, lineCount: 0}\n * @event {Function(e)} input\t\t\t\t\t当键盘输入时,触发 input 事件\n * @event {Function(e)} confirm\t\t\t\t\t点击完成时, 触发 confirm 事件\n * @event {Function(e)} keyboardheightchange\t键盘高度发生变化的时候触发此事件\n * @example <u--textarea v-model=\"value1\" placeholder=\"请输入内容\" ></u--textarea>\n */\nexport default {\n    name: \"u-textarea\",\n    mixins: [uni.$u.mpMixin, uni.$u.mixin, props],\n\tdata() {\n\t\treturn {\n\t\t\t// 输入框的值\n\t\t\tinnerValue: \"\",\n\t\t\t// 是否处于获得焦点状态\n\t\t\tfocused: false,\n\t\t\t// value是否第一次变化,在watch中,由于加入immediate属性,会在第一次触发,此时不应该认为value发生了变化\n\t\t\tfirstChange: true,\n\t\t\t// value绑定值的变化是由内部还是外部引起的\n\t\t\tchangeFromInner: false,\n\t\t\t// 过滤处理方法\n\t\t\tinnerFormatter: value => value\n\t\t}\n\t},\n\twatch: {\n\t    value: {\n\t        immediate: true,\n\t        handler(newVal, oldVal) {\n\t            this.innerValue = newVal;\n\t            /* #ifdef H5 */\n\t            // 在H5中,外部value变化后,修改input中的值,不会触发@input事件,此时手动调用值变化方法\n\t            if (\n\t                this.firstChange === false &&\n\t                this.changeFromInner === false\n\t            ) {\n\t                this.valueChange();\n\t            }\n\t            /* #endif */\n\t            this.firstChange = false;\n\t            // 重置changeFromInner的值为false,标识下一次引起默认为外部引起的\n\t            this.changeFromInner = false;\n\t        },\n\t    },\n\t},\n    computed: {\n        // 组件的类名\n        textareaClass() {\n            let classes = [],\n                { border, disabled, shape } = this;\n            border === \"surround\" &&\n                (classes = classes.concat([\"u-border\", \"u-textarea--radius\"]));\n            border === \"bottom\" &&\n                (classes = classes.concat([\n                    \"u-border-bottom\",\n                    \"u-textarea--no-radius\",\n                ]));\n            disabled && classes.push(\"u-textarea--disabled\");\n            return classes.join(\" \");\n        },\n        // 组件的样式\n        textareaStyle() {\n            const style = {};\n            // #ifdef APP-NVUE\n            // 由于textarea在安卓nvue上的差异性,需要额外再调整其内边距\n            if (uni.$u.os() === \"android\") {\n                style.paddingTop = \"6px\";\n                style.paddingLeft = \"9px\";\n                style.paddingBottom = \"3px\";\n                style.paddingRight = \"6px\";\n            }\n            // #endif\n            return uni.$u.deepMerge(style, uni.$u.addStyle(this.customStyle));\n        },\n    },\n    methods: {\n\t\t// 在微信小程序中,不支持将函数当做props参数,故只能通过ref形式调用\n\t\tsetFormatter(e) {\n\t\t\tthis.innerFormatter = e\n\t\t},\n        onFocus(e) {\n            this.$emit(\"focus\", e);\n        },\n        onBlur(e) {\n            this.$emit(\"blur\", e);\n            // 尝试调用u-form的验证方法\n            uni.$u.formValidate(this, \"blur\");\n        },\n        onLinechange(e) {\n            this.$emit(\"linechange\", e);\n        },\n        onInput(e) {\n\t\t\tlet { value = \"\" } = e.detail || {};\n\t\t\t// 格式化过滤方法\n\t\t\tconst formatter = this.formatter || this.innerFormatter\n\t\t\tconst formatValue = formatter(value)\n\t\t\t// 为了避免props的单向数据流特性,需要先将innerValue值设置为当前值,再在$nextTick中重新赋予设置后的值才有效\n\t\t\tthis.innerValue = value\n\t\t\tthis.$nextTick(() => {\n\t\t\t\tthis.innerValue = formatValue;\n\t\t\t\tthis.valueChange();\n\t\t\t})\n        },\n\t\t// 内容发生变化,进行处理\n\t\tvalueChange() {\n\t\t    const value = this.innerValue;\n\t\t    this.$nextTick(() => {\n\t\t        this.$emit(\"input\", value);\n\t\t        // 标识value值的变化是由内部引起的\n\t\t        this.changeFromInner = true;\n\t\t        this.$emit(\"change\", value);\n\t\t        // 尝试调用u-form的验证方法\n\t\t        uni.$u.formValidate(this, \"change\");\n\t\t    });\n\t\t},\n        onConfirm(e) {\n            this.$emit(\"confirm\", e);\n        },\n        onKeyboardheightchange(e) {\n            this.$emit(\"keyboardheightchange\", e);\n        },\n    },\n};\n</script>\n\n<style lang=\"scss\" scoped>\n@import \"../../libs/css/components.scss\";\n\n.u-textarea {\n    border-radius: 4px;\n    background-color: #fff;\n    position: relative;\n    @include flex;\n    flex: 1;\n\tpadding: 9px;\n\n    &--radius {\n        border-radius: 4px;\n    }\n\n    &--no-radius {\n        border-radius: 0;\n    }\n\n    &--disabled {\n        background-color: #f5f7fa;\n    }\n\n    &__field {\n        flex: 1;\n        font-size: 15px;\n        color: $u-content-color;\n\t\twidth: 100%;\n    }\n\n    &__count {\n        position: absolute;\n        right: 5px;\n        bottom: 2px;\n        font-size: 12px;\n        color: $u-tips-color;\n        background-color: #ffffff;\n        padding: 1px 4px;\n    }\n}\n</style>\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-textarea.vue?vue&type=style&index=0&id=81cd9d32&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-textarea.vue?vue&type=style&index=0&id=81cd9d32&lang=scss&scoped=true&\"","// extracted by mini-css-extract-plugin\n    if(module.hot) {\n      // 1670217885959\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":""}