u-sticky.js.map 14.7 KB
{"version":3,"sources":["webpack:////Users/juvenile/Documents/web/xiaoai/excellent-working/uview-ui/components/u-sticky/u-sticky.vue?9fda","webpack:////Users/juvenile/Documents/web/xiaoai/excellent-working/uview-ui/components/u-sticky/u-sticky.vue?97db","webpack:////Users/juvenile/Documents/web/xiaoai/excellent-working/uview-ui/components/u-sticky/u-sticky.vue?d83d","webpack:////Users/juvenile/Documents/web/xiaoai/excellent-working/uview-ui/components/u-sticky/u-sticky.vue?c8b0","uni-app:///uview-ui/components/u-sticky/u-sticky.vue","webpack:////Users/juvenile/Documents/web/xiaoai/excellent-working/uview-ui/components/u-sticky/u-sticky.vue?b9a7","webpack:////Users/juvenile/Documents/web/xiaoai/excellent-working/uview-ui/components/u-sticky/u-sticky.vue?599b"],"names":[],"mappings":";;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAiI;AACjI;AAC4D;AACL;AACsC;;;AAG7F;AACsN;AACtN,gBAAgB,iNAAU;AAC1B,EAAE,8EAAM;AACR,EAAE,+FAAM;AACR,EAAE,wGAAe;AACjB;AACA;AACA;AACA;AACA;AACA,EAAE,mGAAU;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;AACA;AACA;AACA;;;;;;;;;;;;;;ACRA;AAAA;AAAA;AAAA;AAAo2B,CAAgB,syBAAG,EAAC,C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACoBx3B;;;;;;;;;;;;;;AAcA;AACA,kBADA;AAEA;AACA;AACA;AACA,4BADA;AAEA,gBAFA,EAFA;;AAMA;AACA;AACA,4BADA;AAEA,iBAFA,EAPA;;AAWA;AACA;AACA,mBADA;AAEA,mBAFA,EAZA;;AAgBA;AACA;AACA,4BADA;AAEA,iBAFA,EAjBA;;AAqBA;AACA;AACA,kBADA;AAEA,wBAFA,EAtBA;;AA0BA;AACA;AACA,4BADA;AAEA,iBAFA,EA3BA,EAFA;;;AAkCA,MAlCA,kBAkCA;AACA;AACA,kBADA;AAEA,oBAFA;AAGA,kBAHA;AAIA,6BAJA;AAKA,aALA;AAMA,mBANA;;AAQA,GA3CA;AA4CA;AACA,aADA,qBACA,GADA,EACA;AACA;AACA,KAHA;AAIA,UAJA,kBAIA,GAJA,EAIA;AACA;AACA;AACA;AACA,OAHA,MAGA;AACA;AACA;AACA,KAXA,EA5CA;;AAyDA;AACA,WADA,qBACA;AACA;AACA,KAHA,EAzDA;;AA8DA,SA9DA,qBA8DA;AACA;AACA,GAhEA;AAiEA;AACA,gBADA,0BACA;AACA;;;;;AAKA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAFA;AAGA,OAPA;AAQA,KAnBA;AAoBA,kBApBA,4BAoBA;AACA;AACA;AACA,mCADA;;AAGA;AACA,4BADA;;AAGA;AACA;AACA;AACA,OAHA;AAIA;AACA,KAjCA;AAkCA,YAlCA,oBAkCA,GAlCA,EAkCA;AACA;AACA;AACA;AACA;AACA,KAvCA;AAwCA,sBAxCA,8BAwCA,YAxCA,EAwCA;AACA;AACA;AACA,KA3CA,EAjEA;;AA8GA,eA9GA,2BA8GA;AACA;AACA,GAhHA,E;;;;;;;;;;;;;AClCA;AAAA;AAAA;AAAA;AAA6kD,CAAgB,w5CAAG,EAAC,C;;;;;;;;;;;ACAjmD;AACA,OAAO,KAAU,EAAE,kBAKd","file":"uview-ui/components/u-sticky/u-sticky.js","sourcesContent":["import { render, staticRenderFns, recyclableRender, components } from \"./u-sticky.vue?vue&type=template&id=5d41d740&scoped=true&\"\nvar renderjs\nimport script from \"./u-sticky.vue?vue&type=script&lang=js&\"\nexport * from \"./u-sticky.vue?vue&type=script&lang=js&\"\nimport style0 from \"./u-sticky.vue?vue&type=style&index=0&id=5d41d740&scoped=true&lang=scss&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../../../../../../Applications/HBuilderX.app/Contents/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  \"5d41d740\",\n  null,\n  false,\n  components,\n  renderjs\n)\n\ncomponent.options.__file = \"uview-ui/components/u-sticky/u-sticky.vue\"\nexport default component.exports","export * from \"-!../../../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--16-0!../../../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/template.js!../../../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-uni-app-loader/page-meta.js!../../../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/index.js??vue-loader-options!../../../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./u-sticky.vue?vue&type=template&id=5d41d740&scoped=true&\"","var components\nvar render = function() {\n  var _vm = this\n  var _h = _vm.$createElement\n  var _c = _vm._self._c || _h\n}\nvar recyclableRender = false\nvar staticRenderFns = []\nrender._withStripped = true\n\nexport { render, staticRenderFns, recyclableRender, components }","import mod from \"-!../../../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/babel-loader/lib/index.js!../../../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--12-1!../../../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/script.js!../../../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/index.js??vue-loader-options!../../../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./u-sticky.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/babel-loader/lib/index.js!../../../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--12-1!../../../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/script.js!../../../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/index.js??vue-loader-options!../../../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./u-sticky.vue?vue&type=script&lang=js&\"","<template>\n\t<view class=\"\">\n\t\t<view class=\"u-sticky-wrap\" :class=\"[elClass]\" :style=\"{\n\t\t\theight: fixed ? height + 'px' : 'auto',\n\t\t\tbackgroundColor: bgColor\n\t\t}\">\n\t\t\t<view class=\"u-sticky\" :style=\"{\n\t\t\t\tposition: fixed ? 'fixed' : 'static',\n\t\t\t\ttop: stickyTop + 'px',\n\t\t\t\tleft: left + 'px',\n\t\t\t\twidth: width == 'auto' ? 'auto' : width + 'px',\n\t\t\t\tzIndex: uZIndex\n\t\t\t}\">\n\t\t\t\t<slot></slot>\n\t\t\t</view>\n\t\t</view>\n\t</view>\n</template>\n\n<script>\n\t/**\n\t * sticky 吸顶\n\t * @description 该组件与CSS中position: sticky属性实现的效果一致,当组件达到预设的到顶部距离时, 就会固定在指定位置,组件位置大于预设的顶部距离时,会重新按照正常的布局排列。\n\t * @tutorial https://www.uviewui.com/components/sticky.html\n\t * @property {String Number} offset-top 吸顶时与顶部的距离,单位rpx(默认0)\n\t * @property {String Number} index 自定义标识,用于区分是哪一个组件\n\t * @property {Boolean} enable 是否开启吸顶功能(默认true)\n\t * @property {String} bg-color 组件背景颜色(默认#ffffff)\n\t * @property {String Number} z-index 吸顶时的z-index值(默认970)\n\t * @property {String Number} h5-nav-height 导航栏高度,自定义导航栏时(无导航栏时需设置为0),需要传入此值,单位px(默认44)\n\t * @event {Function} fixed 组件吸顶时触发\n\t * @event {Function} unfixed 组件取消吸顶时触发\n\t * @example <u-sticky offset-top=\"200\"><view>塞下秋来风景异,衡阳雁去无留意</view></u-sticky>\n\t */\n\texport default {\n\t\tname: \"u-sticky\",\n\t\tprops: {\n\t\t\t// 吸顶容器到顶部某个距离的时候,进行吸顶,在H5平台,NavigationBar为44px\n\t\t\toffsetTop: {\n\t\t\t\ttype: [Number, String],\n\t\t\t\tdefault: 0\n\t\t\t},\n\t\t\t//列表中的索引值\n\t\t\tindex: {\n\t\t\t\ttype: [Number, String],\n\t\t\t\tdefault: ''\n\t\t\t},\n\t\t\t// 是否开启吸顶功能\n\t\t\tenable: {\n\t\t\t\ttype: Boolean,\n\t\t\t\tdefault: true\n\t\t\t},\n\t\t\t// h5顶部导航栏的高度\n\t\t\th5NavHeight: {\n\t\t\t\ttype: [Number, String],\n\t\t\t\tdefault: 44\n\t\t\t},\n\t\t\t// 吸顶区域的背景颜色\n\t\t\tbgColor: {\n\t\t\t\ttype: String,\n\t\t\t\tdefault: '#ffffff'\n\t\t\t},\n\t\t\t// z-index值\n\t\t\tzIndex: {\n\t\t\t\ttype: [Number, String],\n\t\t\t\tdefault: ''\n\t\t\t}\n\t\t},\n\t\tdata() {\n\t\t\treturn {\n\t\t\t\tfixed: false,\n\t\t\t\theight: 'auto',\n\t\t\t\tstickyTop: 0,\n\t\t\t\telClass: this.$u.guid(),\n\t\t\t\tleft: 0,\n\t\t\t\twidth: 'auto',\n\t\t\t};\n\t\t},\n\t\twatch: {\n\t\t\toffsetTop(val) {\n\t\t\t\tthis.initObserver();\n\t\t\t},\n\t\t\tenable(val) {\n\t\t\t\tif (val == false) {\n\t\t\t\t\tthis.fixed = false;\n\t\t\t\t\tthis.disconnectObserver('contentObserver');\n\t\t\t\t} else {\n\t\t\t\t\tthis.initObserver();\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\tcomputed: {\n\t\t\tuZIndex() {\n\t\t\t\treturn this.zIndex ? this.zIndex : this.$u.zIndex.sticky;\n\t\t\t}\n\t\t},\n\t\tmounted() {\n\t\t\tthis.initObserver();\n\t\t},\n\t\tmethods: {\n\t\t\tinitObserver() {\n\t\t\t\tif (!this.enable) return;\n\t\t\t\t// #ifdef H5\n\t\t\t\tthis.stickyTop = this.offsetTop != 0 ? uni.upx2px(this.offsetTop) + this.h5NavHeight : this.h5NavHeight;\n\t\t\t\t// #endif\n\t\t\t\t// #ifndef H5\n\t\t\t\tthis.stickyTop = this.offsetTop != 0 ? uni.upx2px(this.offsetTop) : 0;\n\t\t\t\t// #endif\n\n\t\t\t\tthis.disconnectObserver('contentObserver');\n\t\t\t\tthis.$uGetRect('.' + this.elClass).then((res) => {\n\t\t\t\t\tthis.height = res.height;\n\t\t\t\t\tthis.left = res.left;\n\t\t\t\t\tthis.width = res.width;\n\t\t\t\t\tthis.$nextTick(() => {\n\t\t\t\t\t\tthis.observeContent();\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t},\n\t\t\tobserveContent() {\n\t\t\t\tthis.disconnectObserver('contentObserver');\n\t\t\t\tconst contentObserver = this.createIntersectionObserver({\n\t\t\t\t\tthresholds: [0.95, 0.98, 1]\n\t\t\t\t});\n\t\t\t\tcontentObserver.relativeToViewport({\n\t\t\t\t\ttop: -this.stickyTop\n\t\t\t\t});\n\t\t\t\tcontentObserver.observe('.' + this.elClass, res => {\n\t\t\t\t\tif (!this.enable) return;\n\t\t\t\t\tthis.setFixed(res.boundingClientRect.top);\n\t\t\t\t});\n\t\t\t\tthis.contentObserver = contentObserver;\n\t\t\t},\n\t\t\tsetFixed(top) {\n\t\t\t\tconst fixed = top < this.stickyTop;\n\t\t\t\tif (fixed) this.$emit('fixed', this.index);\n\t\t\t\telse if(this.fixed) this.$emit('unfixed', this.index);\n\t\t\t\tthis.fixed = fixed;\n\t\t\t},\n\t\t\tdisconnectObserver(observerName) {\n\t\t\t\tconst observer = this[observerName];\n\t\t\t\tobserver && observer.disconnect();\n\t\t\t},\n\t\t},\n\t\tbeforeDestroy() {\n\t\t\tthis.disconnectObserver('contentObserver');\n\t\t}\n\t};\n</script>\n\n<style scoped lang=\"scss\">\n\t@import \"../../libs/css/style.components.scss\";\n\t\n\t.u-sticky {\n\t\tz-index: 9999999999;\n\t}\n</style>\n","import mod from \"-!../../../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/css-loader/dist/cjs.js??ref--8-oneOf-1-1!../../../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/stylePostLoader.js!../../../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--8-oneOf-1-2!../../../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-3!../../../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/sass-loader/dist/cjs.js??ref--8-oneOf-1-4!../../../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--8-oneOf-1-5!../../../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/index.js??vue-loader-options!../../../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./u-sticky.vue?vue&type=style&index=0&id=5d41d740&scoped=true&lang=scss&\"; export default mod; export * from \"-!../../../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/css-loader/dist/cjs.js??ref--8-oneOf-1-1!../../../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/stylePostLoader.js!../../../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--8-oneOf-1-2!../../../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-3!../../../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/sass-loader/dist/cjs.js??ref--8-oneOf-1-4!../../../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--8-oneOf-1-5!../../../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/index.js??vue-loader-options!../../../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./u-sticky.vue?vue&type=style&index=0&id=5d41d740&scoped=true&lang=scss&\"","// extracted by mini-css-extract-plugin\n    if(module.hot) {\n      // 1700461801694\n      var cssReload = require(\"/Applications/HBuilderX.app/Contents/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":""}