luban-mall/unpackage/dist/dev/.sourcemap/mp-weixin/components/swiper-tab/swiper-tab.js.map

1 line
14 KiB
Plaintext

{"version":3,"sources":["webpack:///D:/鲁班家具小程序/luban-mall/components/swiper-tab/swiper-tab.vue?7f0e","webpack:///D:/鲁班家具小程序/luban-mall/components/swiper-tab/swiper-tab.vue?8960","webpack:///D:/鲁班家具小程序/luban-mall/components/swiper-tab/swiper-tab.vue?0a51","webpack:///D:/鲁班家具小程序/luban-mall/components/swiper-tab/swiper-tab.vue?4b6b","uni-app:///components/swiper-tab/swiper-tab.vue","webpack:///D:/鲁班家具小程序/luban-mall/components/swiper-tab/swiper-tab.vue?2821","webpack:///D:/鲁班家具小程序/luban-mall/components/swiper-tab/swiper-tab.vue?bf18"],"names":[],"mappings":";;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAuH;AACvH;AAC8D;AACL;AACc;;;AAGvE;AACoL;AACpL,gBAAgB,2LAAU;AAC1B,EAAE,gFAAM;AACR,EAAE,qFAAM;AACR,EAAE,8FAAe;AACjB;AACA;AACA;AACA;AACA;AACA,EAAE,yFAAU;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;AAA4rB,CAAgB,0rBAAG,EAAC,C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACsBhtB;AACA;AACA,2BADA;AAEA;AACA,iBADA;AAEA;AACA;AACA,wBADA;AAEA,wBAFA;AAGA,wBAHA;AAIA,wBAJA;AAKA,wBALA;AAMA,wBANA;AAOA,wBAPA;AAQA,wBARA;AASA,wBATA;;AAWA,OAdA,EAFA;;AAkBA,qBAlBA,EAkBA;AACA,qBAnBA,EAmBA;AACA;AACA,mBADA;AAEA,mBAFA,EApBA,EADA;;;AA0BA,MA1BA,kBA0BA;AACA;AACA,qBADA;AAEA,mBAFA;AAGA,mBAHA;AAIA,uBAJA;AAKA,mBALA;;AAOA,GAlCA;AAmCA;AACA,iBADA,2BACA;AACA;AACA,KAHA,EAnCA;;AAwCA;AACA,QADA,kBACA;AACA;AACA,KAHA;AAIA,SAJA,mBAIA;AACA;AACA;AACA,KAPA,EAxCA;;AAiDA,SAjDA,qBAiDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAxDA;AAyDA;AACA,UADA,kBACA,IADA,EACA,KADA,EACA;AACA;AACA,KAHA;AAIA,cAJA,wBAIA;AACA;AACA;AACA;AACA;AACA;AACA,OALA;AAMA,KAXA;AAYA,WAZA,qBAYA;AACA;AACA,kBADA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CADA;AAEA,2EAFA;AAGA,6DAHA;;AAKA,OAXA;AAYA,KA3BA;AA4BA,kBA5BA,4BA4BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SALA;AAMA,OARA;AASA,KAvCA;AAwCA,kBAxCA,0BAwCA,EAxCA,EAwCA,QAxCA,EAwCA;AACA;AACA;AACA,OAFA;AAGA,KA5CA;AA6CA,UA7CA,kBA6CA,CA7CA,EA6CA;AACA;AACA,KA/CA,EAzDA,E;;;;;;;;;;;;;ACtBA;AAAA;AAAA;AAAA;AAA2yC,CAAgB,iuCAAG,EAAC,C;;;;;;;;;;;ACA/zC;AACA,OAAO,KAAU,EAAE,kBAKd","file":"components/swiper-tab/swiper-tab.js","sourcesContent":["import { render, staticRenderFns, recyclableRender, components } from \"./swiper-tab.vue?vue&type=template&id=72dc0878&\"\nvar renderjs\nimport script from \"./swiper-tab.vue?vue&type=script&lang=js&\"\nexport * from \"./swiper-tab.vue?vue&type=script&lang=js&\"\nimport style0 from \"./swiper-tab.vue?vue&type=style&index=0&lang=scss&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../HBuilderX-app开发版/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 null,\n null,\n false,\n components,\n renderjs\n)\n\ncomponent.options.__file = \"components/swiper-tab/swiper-tab.vue\"\nexport default component.exports","export * from \"-!../../../../HBuilderX-app开发版/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../../HBuilderX-app开发版/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--16-0!../../../../HBuilderX-app开发版/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/template.js!../../../../HBuilderX-app开发版/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-uni-app-loader/page-meta.js!../../../../HBuilderX-app开发版/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/index.js??vue-loader-options!../../../../HBuilderX-app开发版/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./swiper-tab.vue?vue&type=template&id=72dc0878&\"","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 \"-!../../../../HBuilderX-app开发版/HBuilderX/plugins/uniapp-cli/node_modules/babel-loader/lib/index.js!../../../../HBuilderX-app开发版/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--12-1!../../../../HBuilderX-app开发版/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/script.js!../../../../HBuilderX-app开发版/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/index.js??vue-loader-options!../../../../HBuilderX-app开发版/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./swiper-tab.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../HBuilderX-app开发版/HBuilderX/plugins/uniapp-cli/node_modules/babel-loader/lib/index.js!../../../../HBuilderX-app开发版/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--12-1!../../../../HBuilderX-app开发版/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/script.js!../../../../HBuilderX-app开发版/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/index.js??vue-loader-options!../../../../HBuilderX-app开发版/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./swiper-tab.vue?vue&type=script&lang=js&\"","<template>\r\n\t<view class=\"tabBlock\" v-if=\"list.length > 0\">\r\n\t\t<scroll-view scroll-x=\"true\" scroll-with-animation :scroll-left=\"tabsScrollLeft\" @scroll=\"scroll\">\r\n\t\t\t<view class=\"tab\" id=\"tab_list\">\r\n\t\t\t\t<!-- 循环体 -->\r\n\t\t\t\t<view v-for=\"(item, index) in list\" :key=\"index\"\r\n\t\t\t\t\t:class=\"['tab__item', {'tab__item--active': currentIndex === index}]\"\r\n\t\t\t\t\t:style=\"{color: (currentIndex === index ? `${itemColor}`: '')}\" id=\"tab_item\"\r\n\t\t\t\t\t@click=\"select(item, index)\">\r\n\t\t\t\t\t<!-- 标题 -->\r\n\t\t\t\t\t<view v-if=\"!showTitleSlot\">{{item.title}}</view>\r\n\t\t\t\t</view>\r\n\t\t\t</view>\r\n\t\t\t<!-- 下划线 -->\r\n\t\t\t<view class=\"tab__line\"\r\n\t\t\t\t:style=\"{background: lineColor, width: lineStyle.width, transform: lineStyle.transform,transitionDuration: lineStyle.transitionDuration}\">\r\n\t\t\t</view>\r\n\t\t</scroll-view>\r\n\t</view>\r\n</template>\r\n\r\n<script>\r\n\texport default {\r\n\t\tprops: {\r\n\t\t\tvalue: [Number, String],\r\n\t\t\tlist: { // 传值\r\n\t\t\t\ttype: Array,\r\n\t\t\t\tdefault: () => {\r\n\t\t\t\t\treturn [\r\n\t\t\t\t\t\t{title:'标题一'},\r\n\t\t\t\t\t\t{title:'标题二'},\r\n\t\t\t\t\t\t{title:'标题三'},\r\n\t\t\t\t\t\t{title:'标题四'},\r\n\t\t\t\t\t\t{title:'标题五'},\r\n\t\t\t\t\t\t{title:'标题六'},\r\n\t\t\t\t\t\t{title:'标题七'},\r\n\t\t\t\t\t\t{title:'标题八'},\r\n\t\t\t\t\t\t{title:'标题九'},\r\n\t\t\t\t\t]\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\titemColor: String, // tab内容颜色\r\n\t\t\tlineColor: String, // 下划线颜色\r\n\t\t\tlineAnimated: { // 是否展示下划线动画\r\n\t\t\t\ttype: Boolean,\r\n\t\t\t\tdefault: true\r\n\t\t\t}\r\n\t\t},\r\n\t\tdata() {\r\n\t\t\treturn {\r\n\t\t\t\tcurrentIndex: 0,\r\n\t\t\t\tlineStyle: {},\r\n\t\t\t\tscrollLeft: 0,\r\n\t\t\t\ttabsScrollLeft: 0,\r\n\t\t\t\tduration: 0.3\r\n\t\t\t}\r\n\t\t},\r\n\t\tcomputed: {\r\n\t\t\tshowTitleSlot() {\r\n\t\t\t\treturn this.$scopedSlots.title\r\n\t\t\t}\r\n\t\t},\r\n\t\twatch: {\r\n\t\t\tlist() {\r\n\t\t\t\tthis.setTabList()\r\n\t\t\t},\r\n\t\t\tvalue() {\r\n\t\t\t\tthis.currentIndex = this.value\r\n\t\t\t\tthis.setTabList()\r\n\t\t\t}\r\n\t\t},\r\n\t\tmounted() {\r\n\t\t\tthis.currentIndex = this.value\r\n\t\t\tthis.setTabList()\r\n\t\t\tif (!this.lineAnimated) {\r\n\t\t\t\tthis.duration = 0\r\n\t\t\t}\r\n\t\t\tconsole.log(this.$scopedSlots)\r\n\t\t},\r\n\t\tmethods: {\r\n\t\t\tselect(item, index) {\r\n\t\t\t\tthis.$emit('changeEv', index)\r\n\t\t\t},\r\n\t\t\tsetTabList() {\r\n\t\t\t\tthis.$nextTick(() => {\r\n\t\t\t\t\tif (this.list.length > 0) {\r\n\t\t\t\t\t\tthis.setLine()\r\n\t\t\t\t\t\tthis.scrollIntoView()\r\n\t\t\t\t\t}\r\n\t\t\t\t})\r\n\t\t\t},\r\n\t\t\tsetLine() {\r\n\t\t\t\tlet lineWidth = 0,\r\n\t\t\t\t\tlineLeft = 0\r\n\t\t\t\tthis.getElementData(`#tab_item`, (data) => {\r\n\t\t\t\t\tlet el = data[this.currentIndex]\r\n\t\t\t\t\tthis.$emit('tabheight',el.height)\r\n\t\t\t\t\tlineWidth = el.width / 2\r\n\t\t\t\t\t// lineLeft = el.width * (this.currentIndex + 0.5) // 此种只能针对每个item长度一致的\r\n\t\t\t\t\tlineLeft = el.width / 2 + (-data[0].left) + el.left\r\n\t\t\t\t\tthis.lineStyle = {\r\n\t\t\t\t\t\twidth: `${lineWidth}px`,\r\n\t\t\t\t\t\ttransform: `translateX(${lineLeft}px) translateX(-50%)`,\r\n\t\t\t\t\t\ttransitionDuration: `${this.duration}s`\r\n\t\t\t\t\t};\r\n\t\t\t\t})\r\n\t\t\t},\r\n\t\t\tscrollIntoView() { // item滚动\r\n\t\t\t\tlet lineLeft = 0;\r\n\t\t\t\tthis.getElementData('#tab_list', (data) => {\r\n\t\t\t\t\tlet list = data[0]\r\n\t\t\t\t\tthis.getElementData(`#tab_item`, (data) => {\r\n\t\t\t\t\t\tlet el = data[this.currentIndex]\r\n\t\t\t\t\t\t// lineLeft = el.width * (this.currentIndex + 0.5) - list.width / 2 - this.scrollLeft\r\n\t\t\t\t\t\tlineLeft = el.width / 2 + (-list.left) + el.left - list.width / 2 - this.scrollLeft\r\n\t\t\t\t\t\tthis.tabsScrollLeft = this.scrollLeft + lineLeft\r\n\t\t\t\t\t})\r\n\t\t\t\t})\r\n\t\t\t},\r\n\t\t\tgetElementData(el, callback) {\r\n\t\t\t\tuni.createSelectorQuery().in(this).selectAll(el).boundingClientRect().exec((data) => {\r\n\t\t\t\t\tcallback(data[0]);\r\n\t\t\t\t});\r\n\t\t\t},\r\n\t\t\tscroll(e) {\r\n\t\t\t\tthis.scrollLeft = e.detail.scrollLeft;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n</script>\r\n\r\n<style lang=\"scss\">\r\n\t.tabBlock {\r\n\t\tposition: relative;\r\n\t\tbackground: #fff;\r\n\t\t.tab {\r\n\t\t\tposition: relative;\r\n\t\t\tdisplay: flex;\r\n\t\t\tfont-size: 28rpx;\r\n\t\t\tpadding-bottom: 15rpx;\r\n\t\t\twhite-space: nowrap;\r\n\t\t\t&__item {\r\n\t\t\t\t// flex: 1;\r\n\t\t\t\t// width: 20%;\r\n\t\t\t\tpadding: 0 20rpx;\r\n\t\t\t\tflex-shrink: 0;\r\n\t\t\t\ttext-align: center;\r\n\t\t\t\tline-height: 90rpx;\r\n\t\t\t\tcolor: #868695;\r\n\t\t\t\t&--active {\r\n\t\t\t\t\tcolor: $uni-color-primary;\r\n\t\t\t\t\tfont-weight: bold;\r\n\t\t\t\t}\r\n\t\t\t\t&-title {\r\n\t\t\t\t\tmargin: 0 40rpx;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t.tab__line {\r\n\t\t\tdisplay: block;\r\n\t\t\theight: 6rpx;\r\n\t\t\tposition: absolute;\r\n\t\t\tbottom: 20rpx;\r\n\t\t\tleft: 0;\r\n\t\t\tz-index: 1;\r\n\t\t\tborder-radius: 6rpx;\r\n\t\t\tposition: relative;\r\n\t\t\tbackground: $uni-color-primary;\r\n\t\t}\r\n\t}\r\n</style>\r\n","import mod from \"-!../../../../HBuilderX-app开发版/HBuilderX/plugins/uniapp-cli/node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../../HBuilderX-app开发版/HBuilderX/plugins/uniapp-cli/node_modules/css-loader/dist/cjs.js??ref--8-oneOf-1-1!../../../../HBuilderX-app开发版/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/stylePostLoader.js!../../../../HBuilderX-app开发版/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--8-oneOf-1-2!../../../../HBuilderX-app开发版/HBuilderX/plugins/uniapp-cli/node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-3!../../../../HBuilderX-app开发版/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/sass-loader/dist/cjs.js??ref--8-oneOf-1-4!../../../../HBuilderX-app开发版/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--8-oneOf-1-5!../../../../HBuilderX-app开发版/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/index.js??vue-loader-options!../../../../HBuilderX-app开发版/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./swiper-tab.vue?vue&type=style&index=0&lang=scss&\"; export default mod; export * from \"-!../../../../HBuilderX-app开发版/HBuilderX/plugins/uniapp-cli/node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../../HBuilderX-app开发版/HBuilderX/plugins/uniapp-cli/node_modules/css-loader/dist/cjs.js??ref--8-oneOf-1-1!../../../../HBuilderX-app开发版/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/stylePostLoader.js!../../../../HBuilderX-app开发版/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--8-oneOf-1-2!../../../../HBuilderX-app开发版/HBuilderX/plugins/uniapp-cli/node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-3!../../../../HBuilderX-app开发版/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/sass-loader/dist/cjs.js??ref--8-oneOf-1-4!../../../../HBuilderX-app开发版/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--8-oneOf-1-5!../../../../HBuilderX-app开发版/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/index.js??vue-loader-options!../../../../HBuilderX-app开发版/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./swiper-tab.vue?vue&type=style&index=0&lang=scss&\"","// extracted by mini-css-extract-plugin\n if(module.hot) {\n // 1658133937972\n var cssReload = require(\"D:/HBuilderX-app开发版/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":""}