1 line
17 KiB
Plaintext
1 line
17 KiB
Plaintext
{"version":3,"sources":["webpack:///E:/云商会/云商会/tuniao-ui/components/tn-switch/tn-switch.vue?58ac","webpack:///E:/云商会/云商会/tuniao-ui/components/tn-switch/tn-switch.vue?3e5a","webpack:///E:/云商会/云商会/tuniao-ui/components/tn-switch/tn-switch.vue?09ac","webpack:///E:/云商会/云商会/tuniao-ui/components/tn-switch/tn-switch.vue?ca35","uni-app:///tuniao-ui/components/tn-switch/tn-switch.vue","webpack:///E:/云商会/云商会/tuniao-ui/components/tn-switch/tn-switch.vue?b955","webpack:///E:/云商会/云商会/tuniao-ui/components/tn-switch/tn-switch.vue?9be1"],"names":["name","props","value","type","default","shape","disabled","size","activeColor","inactiveColor","activeValue","inactiveValue","leftIcon","rightIcon","loading","vibrateShort","computed","switchStyle","style","switchNodeStyle","iconStyle","loadingColor","data","methods","click"],"mappings":";;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAkI;AAClI;AAC6D;AACL;AACsC;;;AAG9F;AAC+L;AAC/L,gBAAgB,wMAAU;AAC1B,EAAE,+EAAM;AACR,EAAE,gGAAM;AACR,EAAE,yGAAe;AACjB;AACA;AACA;AACA;AACA;AACA,EAAE,oGAAU;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,kOAEN;AACP,KAAK;AACL;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;AChDA;AAAA;AAAA;AAAA;AAAquB,CAAgB,0vBAAG,EAAC,C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eCwCzvB;EACAA;EACAC;IACAC;MACAC;MACAC;IACA;IACA;IACA;IACAC;MACAF;MACAC;IACA;IACA;IACAE;MACAH;MACAC;IACA;IACA;IACAG;MACAJ;MACAC;IACA;IACA;IACAI;MACAL;MACAC;IACA;IACA;IACAK;MACAN;MACAC;IACA;IACA;IACAM;MACAP;MACAC;IACA;IACA;IACAO;MACAR;MACAC;IACA;IACA;IACAQ;MACAT;MACAC;IACA;IACA;IACAS;MACAV;MACAC;IACA;IACA;IACAU;MACAX;MACAC;IACA;IACA;IACAW;MACAZ;MACAC;IACA;EACA;EACAY;IACAC;MACA;MACAC;MACAA,qCACA,kDACA;MACA;IACA;IACAC;MACA;MACAD;MACAA;MACA;IACA;IACAE;MACA;MACAF;MACAA;MACA;IACA;IACAG;MACA;IACA;EACA;EACAC;IACA,QAEA;EACA;EACAC;IACAC;MAAA;MACA;QACA;QACA;QACA;QACA;UACA;QACA;MACA;IACA;EACA;AACA;AAAA,2B;;;;;;;;;;;;;AClJA;AAAA;AAAA;AAAA;AAAg5C,CAAgB,62CAAG,EAAC,C;;;;;;;;;;;ACAp6C;AACA,OAAO,KAAU,EAAE,kBAKd","file":"tuniao-ui/components/tn-switch/tn-switch.js","sourcesContent":["import { render, staticRenderFns, recyclableRender, components } from \"./tn-switch.vue?vue&type=template&id=b279ce68&scoped=true&\"\nvar renderjs\nimport script from \"./tn-switch.vue?vue&type=script&lang=js&\"\nexport * from \"./tn-switch.vue?vue&type=script&lang=js&\"\nimport style0 from \"./tn-switch.vue?vue&type=style&index=0&id=b279ce68&lang=scss&scoped=true&\"\n\n\n/* normalize component */\nimport normalizer from \"!F:\\\\HBuilderX.3.5.3.20220729\\\\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 \"b279ce68\",\n null,\n false,\n components,\n renderjs\n)\n\ncomponent.options.__file = \"tuniao-ui/components/tn-switch/tn-switch.vue\"\nexport default component.exports","export * from \"-!F:\\\\HBuilderX.3.5.3.20220729\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\vue-loader\\\\lib\\\\loaders\\\\templateLoader.js??vue-loader-options!F:\\\\HBuilderX.3.5.3.20220729\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\webpack-preprocess-loader\\\\index.js??ref--17-0!F:\\\\HBuilderX.3.5.3.20220729\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\webpack-uni-mp-loader\\\\lib\\\\template.js!F:\\\\HBuilderX.3.5.3.20220729\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\webpack-uni-app-loader\\\\page-meta.js!F:\\\\HBuilderX.3.5.3.20220729\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\vue-loader\\\\lib\\\\index.js??vue-loader-options!F:\\\\HBuilderX.3.5.3.20220729\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\webpack-uni-mp-loader\\\\lib\\\\style.js!./tn-switch.vue?vue&type=template&id=b279ce68&scoped=true&\"","var components\ntry {\n components = {\n tnLoading: function () {\n return import(\n /* webpackChunkName: \"tuniao-ui/components/tn-loading/tn-loading\" */ \"@/tuniao-ui/components/tn-loading/tn-loading.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.switchStyle])\n var s1 = _vm.__get_style([_vm.switchNodeStyle])\n var s2 = _vm.leftIcon !== \"\" ? _vm.__get_style([_vm.iconStyle]) : null\n var s3 = _vm.rightIcon !== \"\" ? _vm.__get_style([_vm.iconStyle]) : null\n _vm.$mp.data = Object.assign(\n {},\n {\n $root: {\n s0: s0,\n s1: s1,\n s2: s2,\n s3: s3,\n },\n }\n )\n}\nvar recyclableRender = false\nvar staticRenderFns = []\nrender._withStripped = true\n\nexport { render, staticRenderFns, recyclableRender, components }","import mod from \"-!F:\\\\HBuilderX.3.5.3.20220729\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\babel-loader\\\\lib\\\\index.js!F:\\\\HBuilderX.3.5.3.20220729\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\webpack-preprocess-loader\\\\index.js??ref--13-1!F:\\\\HBuilderX.3.5.3.20220729\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\webpack-uni-mp-loader\\\\lib\\\\script.js!F:\\\\HBuilderX.3.5.3.20220729\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\vue-loader\\\\lib\\\\index.js??vue-loader-options!F:\\\\HBuilderX.3.5.3.20220729\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\webpack-uni-mp-loader\\\\lib\\\\style.js!./tn-switch.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!F:\\\\HBuilderX.3.5.3.20220729\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\babel-loader\\\\lib\\\\index.js!F:\\\\HBuilderX.3.5.3.20220729\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\webpack-preprocess-loader\\\\index.js??ref--13-1!F:\\\\HBuilderX.3.5.3.20220729\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\webpack-uni-mp-loader\\\\lib\\\\script.js!F:\\\\HBuilderX.3.5.3.20220729\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\vue-loader\\\\lib\\\\index.js??vue-loader-options!F:\\\\HBuilderX.3.5.3.20220729\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\webpack-uni-mp-loader\\\\lib\\\\style.js!./tn-switch.vue?vue&type=script&lang=js&\"","<template>\r\n <view\r\n class=\"tn-switch-class tn-switch\"\r\n :class=\"[\r\n value ? 'tn-switch--on' : '',\r\n disabled ? 'tn-switch--disabled' : '',\r\n `tn-switch--${shape}`\r\n ]\"\r\n :style=\"[switchStyle]\"\r\n @tap=\"click\"\r\n >\r\n <view\r\n class=\"tn-switch__node\"\r\n :class=\"[`tn-switch__node--${shape}`]\"\r\n :style=\"[switchNodeStyle]\"\r\n >\r\n <tn-loading class=\"tn-switch__node__loading\" :show=\"loading\" mode=\"flower\" :size=\"size * 0.6\" :color=\"loadingColor\"></tn-loading>\r\n </view>\r\n <!-- 左图标 -->\r\n <view\r\n v-if=\"leftIcon !== ''\"\r\n class=\"tn-switch__icon tn-switch__icon--left\"\r\n :class=\"[\r\n `tn-icon-${leftIcon}`,\r\n value ? 'tn-switch__icon--show' : ''\r\n ]\"\r\n :style=\"[iconStyle]\"></view>\r\n <!-- 右图标 -->\r\n <view \r\n v-if=\"rightIcon !== ''\"\r\n class=\"tn-switch__icon tn-switch__icon--right\"\r\n :class=\"[\r\n `tn-icon-${rightIcon}`,\r\n !value ? 'tn-switch__icon--show' : ''\r\n ]\"\r\n :style=\"[iconStyle]\"></view>\r\n </view>\r\n</template>\r\n\r\n<script>\r\n export default {\r\n name: 'tn-switch',\r\n props: {\r\n value: {\r\n type: Boolean,\r\n default: false\r\n },\r\n // 按钮的样式\r\n // circle 圆角 square 方形\r\n shape: {\r\n type: String,\r\n default: 'circle'\r\n },\r\n // 是否禁用\r\n disabled: {\r\n type: Boolean,\r\n default: false\r\n },\r\n // 尺寸\r\n size: {\r\n type: Number,\r\n default: 50\r\n },\r\n // 打开时的背景颜色\r\n activeColor: {\r\n type: String,\r\n default: ''\r\n },\r\n // 关闭时的背景颜色\r\n inactiveColor: {\r\n type: String,\r\n default: ''\r\n },\r\n // 激活时的值\r\n activeValue: {\r\n type: [Number, String, Boolean],\r\n default: true\r\n },\r\n // 关闭时的值\r\n inactiveValue: {\r\n type: [Number, String, Boolean],\r\n default: false\r\n },\r\n // 左图标\r\n leftIcon: {\r\n type: String,\r\n default: ''\r\n },\r\n // 右图标\r\n rightIcon: {\r\n type: String,\r\n default: ''\r\n },\r\n // 是否为加载状态\r\n loading: {\r\n type: Boolean,\r\n default: false\r\n },\r\n // 点击手机是否震动\r\n vibrateShort: {\r\n type: Boolean,\r\n default: false\r\n }\r\n },\r\n computed: {\r\n switchStyle() {\r\n let style = {}\r\n style.fontSize = this.$tn.string.getLengthUnitValue(this.size)\r\n style.backgroundColor = this.value ? \r\n this.activeColor ? this.activeColor : '#01BEFF' : \r\n this.inactiveColor ? this.inactiveColor : '#AAAAAA'\r\n return style\r\n },\r\n switchNodeStyle() {\r\n let style = {}\r\n style.width = this.$tn.string.getLengthUnitValue(this.size)\r\n style.height = style.width\r\n return style\r\n },\r\n iconStyle() {\r\n let style = {}\r\n style.fontSize = this.$tn.string.getLengthUnitValue(this.size - 20)\r\n style.lineHeight = this.$tn.string.getLengthUnitValue(this.size)\r\n return style\r\n },\r\n loadingColor() {\r\n return this.value ? this.activeColor : ''\r\n }\r\n },\r\n data() {\r\n return {\r\n \r\n }\r\n },\r\n methods: {\r\n click() {\r\n if (!this.disabled && !this.loading) {\r\n if (this.vibrateShort) uni.vibrateShort()\r\n this.$emit('input', !this.value)\r\n // 放到下一个生命周期,因为双向绑定的value修改父组件状态需要时间,且是异步的\r\n this.$nextTick(() => {\r\n \tthis.$emit('change', this.value ? this.activeValue : this.inactiveValue);\r\n })\r\n }\r\n }\r\n }\r\n }\r\n</script>\r\n\r\n<style lang=\"scss\" scoped>\r\n \r\n .tn-switch {\r\n /* #ifndef APP-NVUE */\r\n display: inline-block;\r\n /* #endif */\r\n position: relative;\r\n box-sizing: initial;\r\n width: 2em;\r\n height: 1em;\r\n font-size: 50rpx;\r\n background-color: #AAAAAA;\r\n transition: background-color 0.3s;\r\n \r\n &__node {\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n justify-content: center;\r\n position: absolute;\r\n top: 0;\r\n left: 0;\r\n z-index: 1;\r\n background-color: #FFFFFF;\r\n transform: scale(0.9);\r\n box-shadow: 0 6rpx 2rpx 0 rgba(0, 0, 0, 0.05), 0 4rpx 4rpx 0 rgba(0, 0, 0, 0.1), 0 6rpx 6rpx 0 rgba(0, 0, 0, 0.05);\r\n transition: transform 0.3s cubic-bezier(0.3, 1.05, 0.4, 1.05);\r\n -webkit-transition: transform 0.3s cubic-bezier(0.3, 1.05, 0.4, 1.05);\r\n \r\n &__loading {\r\n display: flex;\r\n flex-direction: row;\r\n align-items: center;\r\n justify-content: center;\r\n }\r\n \r\n &--circle {\r\n border-radius: 100%;\r\n }\r\n \r\n &--square {\r\n border-radius: 15%;\r\n }\r\n }\r\n \r\n &__icon {\r\n color: #FFFFFF;\r\n font-size: 30rpx;\r\n line-height: 50rpx;\r\n height: 100%;\r\n vertical-align: middle;\r\n position: absolute;\r\n transform: scale(0);\r\n transform-origin: 50% 50%;\r\n transition: transform 0.3s ease-in-out;\r\n \r\n &--left {\r\n top: 0;\r\n left: 10rpx;\r\n }\r\n \r\n &--right {\r\n top: 0;\r\n right: 10rpx;\r\n }\r\n \r\n &--show {\r\n transform: scale(1);\r\n }\r\n }\r\n \r\n &--circle {\r\n border-radius: 1em;\r\n }\r\n \r\n &--square {\r\n border-radius: 0.1em;\r\n }\r\n \r\n &--on {\r\n background-color: $tn-main-color;\r\n \r\n .tn-switch__node {\r\n transform: translateX(100%) scale(0.9);\r\n }\r\n }\r\n \r\n &--disabled {\r\n opacity: 0.4;\r\n }\r\n }\r\n</style>\r\n","import mod from \"-!F:\\\\HBuilderX.3.5.3.20220729\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\mini-css-extract-plugin\\\\dist\\\\loader.js??ref--8-oneOf-1-0!F:\\\\HBuilderX.3.5.3.20220729\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\css-loader\\\\dist\\\\cjs.js??ref--8-oneOf-1-1!F:\\\\HBuilderX.3.5.3.20220729\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\vue-loader\\\\lib\\\\loaders\\\\stylePostLoader.js!F:\\\\HBuilderX.3.5.3.20220729\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\webpack-preprocess-loader\\\\index.js??ref--8-oneOf-1-2!F:\\\\HBuilderX.3.5.3.20220729\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\postcss-loader\\\\src\\\\index.js??ref--8-oneOf-1-3!F:\\\\HBuilderX.3.5.3.20220729\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\sass-loader\\\\dist\\\\cjs.js??ref--8-oneOf-1-4!F:\\\\HBuilderX.3.5.3.20220729\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\webpack-preprocess-loader\\\\index.js??ref--8-oneOf-1-5!F:\\\\HBuilderX.3.5.3.20220729\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\vue-loader\\\\lib\\\\index.js??vue-loader-options!F:\\\\HBuilderX.3.5.3.20220729\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\webpack-uni-mp-loader\\\\lib\\\\style.js!./tn-switch.vue?vue&type=style&index=0&id=b279ce68&lang=scss&scoped=true&\"; export default mod; export * from \"-!F:\\\\HBuilderX.3.5.3.20220729\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\mini-css-extract-plugin\\\\dist\\\\loader.js??ref--8-oneOf-1-0!F:\\\\HBuilderX.3.5.3.20220729\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\css-loader\\\\dist\\\\cjs.js??ref--8-oneOf-1-1!F:\\\\HBuilderX.3.5.3.20220729\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\vue-loader\\\\lib\\\\loaders\\\\stylePostLoader.js!F:\\\\HBuilderX.3.5.3.20220729\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\webpack-preprocess-loader\\\\index.js??ref--8-oneOf-1-2!F:\\\\HBuilderX.3.5.3.20220729\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\postcss-loader\\\\src\\\\index.js??ref--8-oneOf-1-3!F:\\\\HBuilderX.3.5.3.20220729\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\sass-loader\\\\dist\\\\cjs.js??ref--8-oneOf-1-4!F:\\\\HBuilderX.3.5.3.20220729\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\webpack-preprocess-loader\\\\index.js??ref--8-oneOf-1-5!F:\\\\HBuilderX.3.5.3.20220729\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\vue-cli-plugin-uni\\\\packages\\\\vue-loader\\\\lib\\\\index.js??vue-loader-options!F:\\\\HBuilderX.3.5.3.20220729\\\\HBuilderX\\\\plugins\\\\uniapp-cli\\\\node_modules\\\\@dcloudio\\\\webpack-uni-mp-loader\\\\lib\\\\style.js!./tn-switch.vue?vue&type=style&index=0&id=b279ce68&lang=scss&scoped=true&\"","// extracted by mini-css-extract-plugin\n if(module.hot) {\n // 1715648904107\n var cssReload = require(\"F:/HBuilderX.3.5.3.20220729/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":""} |