You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

1 lines
15 KiB

{"version":3,"sources":["webpack:///G:/web/中龙小程序/zhonglmini/components/ms-tabs/ms-tabs.vue?ea22","webpack:///G:/web/中龙小程序/zhonglmini/components/ms-tabs/ms-tabs.vue?1a24","webpack:///G:/web/中龙小程序/zhonglmini/components/ms-tabs/ms-tabs.vue?10a3","webpack:///G:/web/中龙小程序/zhonglmini/components/ms-tabs/ms-tabs.vue?13e8","uni-app:///components/ms-tabs/ms-tabs.vue","webpack:///G:/web/中龙小程序/zhonglmini/components/ms-tabs/ms-tabs.vue?0c10","webpack:///G:/web/中龙小程序/zhonglmini/components/ms-tabs/ms-tabs.vue?4822"],"names":["props","value","list","type","default","itemColor","lineColor","lineAnimated","data","currentIndex","lineStyle","scrollLeft","tabsScrollLeft","duration","computed","showTitleSlot","watch","mounted","console","methods","select","setTabList","setLine","lineLeft","lineWidth","width","transform","transitionDuration","scrollIntoView","getElementData","uni","callback","scroll"],"mappings":";;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAoH;AACpH;AAC2D;AACL;AACc;;;AAGpE;AACqL;AACrL,gBAAgB,0LAAU;AAC1B,EAAE,6EAAM;AACR,EAAE,kFAAM;AACR,EAAE,2FAAe;AACjB;AACA;AACA;AACA;AACA;AACA,EAAE,sFAAU;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;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;AClCA;AAAA;AAAA;AAAA;AAAirB,CAAgB,krBAAG,EAAC,C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBC2BrsB;EACAA;IACAC;IACAC;MAAA;MACAC;MACAC;QACA;MACA;IACA;IACAC;IAAA;IACAC;IAAA;IACAC;MAAA;MACAJ;MACAC;IACA;EACA;EACAI;IACA;MACAC;MACAC;MACAC;MACAC;MACAC;IACA;EACA;EACAC;IACAC;MACA;IACA;EACA;EACAC;IACAd;MACA;IACA;IACAD;MACA;MACA;IACA;EACA;EACAgB;IACA;IACA;IACA;MACA;IACA;IACAC;EACA;EACAC;IACAC;MACA;IACA;IACAC;MAAA;MACA;QACA;UACA;UACA;QACA;MACA;IACA;IACAC;MAAA;MACA;QAAAC;MACA;QACA;QACAC;QACA;QACAD;QACA;UACAE;UACAC;UACAC;QACA;MACA;IACA;IACAC;MAAA;MAAA;MACA;MACA;QACA;QACA;UACA;UACA;UACAL;UACA;QACA;MACA;IACA;IACAM;MACAC;QACAC;MACA;IACA;IACAC;MACA;IACA;EACA;AACA;AAAA,4B;;;;;;;;;;;;;ACzHA;AAAA;AAAA;AAAA;AAA4xC,CAAgB,qtCAAG,EAAC,C;;;;;;;;;;;ACAhzC;AACA,OAAO,KAAU,EAAE,kBAKd","file":"components/ms-tabs/ms-tabs.js","sourcesContent":["import { render, staticRenderFns, recyclableRender, components } from \"./ms-tabs.vue?vue&type=template&id=0f81d6e0&\"\nvar renderjs\nimport script from \"./ms-tabs.vue?vue&type=script&lang=js&\"\nexport * from \"./ms-tabs.vue?vue&type=script&lang=js&\"\nimport style0 from \"./ms-tabs.vue?vue&type=style&index=0&lang=scss&\"\n\n\n/* normalize component */\nimport normalizer from \"!F:\\\\软件\\\\HBuilder X\\\\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/ms-tabs/ms-tabs.vue\"\nexport default component.exports","export * from \"-!F:\\\\软件\\\\HBuilder X\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\vue-loader\\\\lib\\\\loaders\\\\templateLoader.js??vue-loader-options!F:\\\\软件\\\\HBuilder X\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\webpack-preprocess-loader\\\\index.js??ref--17-0!F:\\\\软件\\\\HBuilder X\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\webpack-uni-mp-loader\\\\lib\\\\template.js!F:\\\\软件\\\\HBuilder X\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\webpack-uni-app-loader\\\\page-meta.js!F:\\\\软件\\\\HBuilder X\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\vue-loader\\\\lib\\\\index.js??vue-loader-options!F:\\\\软件\\\\HBuilder X\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\webpack-uni-mp-loader\\\\lib\\\\style.js!./ms-tabs.vue?vue&type=template&id=0f81d6e0&\"","var components\nvar render = function () {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n var g0 = _vm.list.length\n _vm.$initSSP()\n var l0 =\n g0 > 0\n ? _vm.__map(_vm.list, function (item, index) {\n var $orig = _vm.__get_orig(item)\n if (_vm.$scope.data.scopedSlotsCompiler === \"augmented\") {\n _vm.$setSSP(\"title\", {\n title: $orig.fenlmc,\n })\n }\n return {\n $orig: $orig,\n }\n })\n : null\n _vm.$mp.data = Object.assign(\n {},\n {\n $root: {\n g0: g0,\n l0: l0,\n },\n }\n )\n _vm.$callSSP()\n}\nvar recyclableRender = false\nvar staticRenderFns = []\nrender._withStripped = true\n\nexport { render, staticRenderFns, recyclableRender, components }","import mod from \"-!F:\\\\软件\\\\HBuilder X\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\babel-loader\\\\lib\\\\index.js!F:\\\\软件\\\\HBuilder X\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\webpack-preprocess-loader\\\\index.js??ref--13-1!F:\\\\软件\\\\HBuilder X\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\webpack-uni-mp-loader\\\\lib\\\\script.js!F:\\\\软件\\\\HBuilder X\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\vue-loader\\\\lib\\\\index.js??vue-loader-options!F:\\\\软件\\\\HBuilder X\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\webpack-uni-mp-loader\\\\lib\\\\style.js!./ms-tabs.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!F:\\\\软件\\\\HBuilder X\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\babel-loader\\\\lib\\\\index.js!F:\\\\软件\\\\HBuilder X\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\webpack-preprocess-loader\\\\index.js??ref--13-1!F:\\\\软件\\\\HBuilder X\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\webpack-uni-mp-loader\\\\lib\\\\script.js!F:\\\\软件\\\\HBuilder X\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\vue-loader\\\\lib\\\\index.js??vue-loader-options!F:\\\\软件\\\\HBuilder X\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\webpack-uni-mp-loader\\\\lib\\\\style.js!./ms-tabs.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<view v-for=\"(item, index) in list\"\r\n\t\t\t\t\t :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}`: '')}\"\r\n\t\t\t\t\t id=\"tab_item\"\r\n\t\t\t\t\t @click=\"select(item, index)\"\r\n\t\t\t\t>\r\n\t\t\t\t\t<view class=\"tab__item-title\">\r\n\t\t\t\t\t\t<slot name=\"title\" :title=\"item.fenlmc\"></slot>\r\n\t\t\t\t\t</view>\r\n\t\t\t\t\t<view v-if=\"!showTitleSlot\" class=\"tab__item-title\">\r\n\t\t\t\t\t\t{{item.fenlmc}}\r\n\t\t\t\t\t</view>\r\n\t\t\t\t</view>\r\n\t\t\t</view>\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}\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('input', 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, lineLeft = 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\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: 30rpx;\r\n\t\t\tpadding-bottom: 12rpx;\r\n\t\t\twhite-space: nowrap;\r\n\t\t\t&__item {\r\n\t\t\t\tflex: 1;\r\n\t\t\t\t// width: 30%;\r\n\t\t\t\ttext-align: center;\r\n\t\t\t\tline-height: 90rpx;\r\n\t\t\t\tcolor: $uni-text-color;\r\n\t\t\t\t&--active {\r\n\t\t\t\t\tcolor: $uni-color-primary;\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: 15rpx;\r\n\t\t\tleft: 0;\r\n\t\t\tz-index: 1;\r\n\t\t\tborder-radius: 3rpx;\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 \"-!F:\\\\软件\\\\HBuilder X\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\mini-css-extract-plugin\\\\dist\\\\loader.js??ref--8-oneOf-1-0!F:\\\\软件\\\\HBuilder X\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\css-loader\\\\dist\\\\cjs.js??ref--8-oneOf-1-1!F:\\\\软件\\\\HBuilder X\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\vue-loader\\\\lib\\\\loaders\\\\stylePostLoader.js!F:\\\\软件\\\\HBuilder X\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\webpack-preprocess-loader\\\\index.js??ref--8-oneOf-1-2!F:\\\\软件\\\\HBuilder X\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\postcss-loader\\\\src\\\\index.js??ref--8-oneOf-1-3!F:\\\\软件\\\\HBuilder X\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\sass-loader\\\\dist\\\\cjs.js??ref--8-oneOf-1-4!F:\\\\软件\\\\HBuilder X\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\webpack-preprocess-loader\\\\index.js??ref--8-oneOf-1-5!F:\\\\软件\\\\HBuilder X\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\vue-loader\\\\lib\\\\index.js??vue-loader-options!F:\\\\软件\\\\HBuilder X\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\webpack-uni-mp-loader\\\\lib\\\\style.js!./ms-tabs.vue?vue&type=style&index=0&lang=scss&\"; export default mod; export * from \"-!F:\\\\软件\\\\HBuilder X\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\mini-css-extract-plugin\\\\dist\\\\loader.js??ref--8-oneOf-1-0!F:\\\\软件\\\\HBuilder X\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\css-loader\\\\dist\\\\cjs.js??ref--8-oneOf-1-1!F:\\\\软件\\\\HBuilder X\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\vue-loader\\\\lib\\\\loaders\\\\stylePostLoader.js!F:\\\\软件\\\\HBuilder X\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\webpack-preprocess-loader\\\\index.js??ref--8-oneOf-1-2!F:\\\\软件\\\\HBuilder X\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\postcss-loader\\\\src\\\\index.js??ref--8-oneOf-1-3!F:\\\\软件\\\\HBuilder X\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\sass-loader\\\\dist\\\\cjs.js??ref--8-oneOf-1-4!F:\\\\软件\\\\HBuilder X\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\webpack-preprocess-loader\\\\index.js??ref--8-oneOf-1-5!F:\\\\软件\\\\HBuilder X\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\vue-loader\\\\lib\\\\index.js??vue-loader-options!F:\\\\软件\\\\HBuilder X\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\webpack-uni-mp-loader\\\\lib\\\\style.js!./ms-tabs.vue?vue&type=style&index=0&lang=scss&\"","// extracted by mini-css-extract-plugin\n if(module.hot) {\n // 1720092621344\n var cssReload = require(\"F:/软件/HBuilder X/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":""}