1 |
- {"version":3,"sources":["webpack:///D:/yzm/worknew/wardrobe/tm-vuetify/components/tm-dragGrid/tm-dragGrid.vue?9d8a","webpack:///D:/yzm/worknew/wardrobe/tm-vuetify/components/tm-dragGrid/tm-dragGrid.vue?6c19","webpack:///D:/yzm/worknew/wardrobe/tm-vuetify/components/tm-dragGrid/tm-dragGrid.vue?17ea","webpack:///D:/yzm/worknew/wardrobe/tm-vuetify/components/tm-dragGrid/tm-dragGrid.vue?0cd7","uni-app:///tm-vuetify/components/tm-dragGrid/tm-dragGrid.vue","webpack:///D:/yzm/worknew/wardrobe/tm-vuetify/components/tm-dragGrid/tm-dragGrid.vue?e676","webpack:///D:/yzm/worknew/wardrobe/tm-vuetify/components/tm-dragGrid/tm-dragGrid.vue?acc3"],"names":[],"mappings":"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","file":"tm-vuetify/components/tm-dragGrid/tm-dragGrid.js","sourcesContent":["import { render, staticRenderFns, recyclableRender, components } from \"./tm-dragGrid.vue?vue&type=template&id=2ab2a82b&scoped=true&\"\nvar renderjs\nimport script from \"./tm-dragGrid.vue?vue&type=script&lang=js&\"\nexport * from \"./tm-dragGrid.vue?vue&type=script&lang=js&\"\nimport style0 from \"./tm-dragGrid.vue?vue&type=style&index=0&id=2ab2a82b&lang=scss&scoped=true&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../../exe/HBuilderX.3.4.7.20220422/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 \"2ab2a82b\",\n null,\n false,\n components,\n renderjs\n)\n\ncomponent.options.__file = \"tm-vuetify/components/tm-dragGrid/tm-dragGrid.vue\"\nexport default component.exports","export * from \"-!../../../../../exe/HBuilderX.3.4.7.20220422/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../../../exe/HBuilderX.3.4.7.20220422/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--16-0!../../../../../exe/HBuilderX.3.4.7.20220422/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/template.js!../../../../../exe/HBuilderX.3.4.7.20220422/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-uni-app-loader/page-meta.js!../../../../../exe/HBuilderX.3.4.7.20220422/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/index.js??vue-loader-options!../../../../../exe/HBuilderX.3.4.7.20220422/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./tm-dragGrid.vue?vue&type=template&id=2ab2a82b&scoped=true&\"","var components\ntry {\n components = {\n tmBadges: function() {\n return import(\n /* webpackChunkName: \"tm-vuetify/components/tm-badges/tm-badges\" */ \"@/tm-vuetify/components/tm-badges/tm-badges.vue\"\n )\n },\n tmIcons: function() {\n return import(\n /* webpackChunkName: \"tm-vuetify/components/tm-icons/tm-icons\" */ \"@/tm-vuetify/components/tm-icons/tm-icons.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 l0 = _vm.__map(_vm.listData, function(item, index) {\n var $orig = _vm.__get_orig(item)\n\n if (_vm.$scope.data.scopedSlotsCompiler === \"augmented\") {\n _vm.$setScopedSlotsParams(\"default\", {\n item: $orig.data\n })\n }\n\n return {\n $orig: $orig\n }\n })\n\n _vm.$mp.data = Object.assign(\n {},\n {\n $root: {\n l0: l0\n }\n }\n )\n}\nvar recyclableRender = false\nvar staticRenderFns = []\nrender._withStripped = true\n\nexport { render, staticRenderFns, recyclableRender, components }","import mod from \"-!../../../../../exe/HBuilderX.3.4.7.20220422/HBuilderX/plugins/uniapp-cli/node_modules/babel-loader/lib/index.js!../../../../../exe/HBuilderX.3.4.7.20220422/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--12-1!../../../../../exe/HBuilderX.3.4.7.20220422/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/script.js!../../../../../exe/HBuilderX.3.4.7.20220422/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/index.js??vue-loader-options!../../../../../exe/HBuilderX.3.4.7.20220422/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./tm-dragGrid.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../../exe/HBuilderX.3.4.7.20220422/HBuilderX/plugins/uniapp-cli/node_modules/babel-loader/lib/index.js!../../../../../exe/HBuilderX.3.4.7.20220422/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--12-1!../../../../../exe/HBuilderX.3.4.7.20220422/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/script.js!../../../../../exe/HBuilderX.3.4.7.20220422/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/index.js??vue-loader-options!../../../../../exe/HBuilderX.3.4.7.20220422/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./tm-dragGrid.vue?vue&type=script&lang=js&\"","<template>\r\n\t<view class=\"tm-dragGrid relative fulled\" :style=\"{height:totalH+'px'}\">\r\n\t\t\r\n\t\t<view class=\"absolute \"\r\n\t\t:class=\"[ani&&!disabled?'aniOn':'',nowMove_index==index||endDrage?'':'tranAni']\"\r\n\t\t:style=\"{\r\n\t\t\twidth:itemWidth+'px',\r\n\t\t\theight:h+'px',\r\n\t\t\tleft:item.left+'px',\r\n\t\t\ttop:item.top+'px',\r\n\t\t\tzIndex:nowMove_index==index?5:0\r\n\t\t}\"\r\n\t\tv-for=\"(item,index) in listData\"\r\n\t\t:key=\"index\"\r\n\t\t:id=\"'tm-dragGrid-' + index\"\r\n\t\t@touchstart=\"m_start($event,index)\"\r\n\t\t@mousedown=\"m_start($event,index)\"\r\n\t\t@touchmove.stop.prevent=\"m_move($event,index)\" \r\n\t\t@mousemove.stop.prevent=\"m_move($event,index)\"\r\n\t\t@touchend=\"m_end($event,index)\" \r\n\t\t@mouseup=\"m_end($event,index)\"\r\n\t\t@longpress=\"startEdit\"\r\n\t\t>\r\n\t\t<slot name=\"default\" :item=\"item.data\">\r\n\t\t\t<view v-if=\"model==0\" class=\"flex-center flex-col\" style=\"width:70%\">\r\n\t\t\t\t<view style=\"width:100%\"><tm-badges @click.stop=\"delitem(item)\" v-if=\"!disabled\" :offset=\"[0,-5]\" icon=\"icon-times\"></tm-badges></view>\r\n\t\t\t\t<tm-icons :size=\"45\" :name=\"item.data.icon\" :color=\"item.data.color\"></tm-icons>\r\n\t\t\t\t<text class=\"text-size-s pt-10\">{{item.data.text}}</text>\r\n\t\t\t</view>\r\n\t\t\t<view v-if=\"model==1\" style=\"width:100%;height:100%\">\r\n\t\t\t\t<tm-badges @click.stop=\"delitem(item)\" v-if=\"!disabled\" :offset=\"[-5,-5]\" icon=\"icon-times\"></tm-badges>\r\n\t\t\t\t<view :class=\"['bg-gradient-'+item.data.color+'-accent']\" class=\" flex-center round-4 text-size-s\" style=\"width: 90%;height:100rpx\">\r\n\t\t\t\t\t{{item.data.text}}\r\n\t\t\t\t</view>\r\n\t\t\t</view>\r\n\t\t</slot>\r\n\t\t</view>\r\n\t</view>\r\n</template>\r\n\r\n<script>\r\n\t/**\r\n\t * 宫格拖动排序\r\n\t * @property {Number} col = [] 4,一行排列几个\r\n\t * @property {Number} width = [] 0,组件宽度,可以不设置默认取父组件宽度\r\n\t * @property {Number} itemHeight = [] 120,项目的高度\r\n\t * @property {Boolean} ani = [] true,是否开启拖动显示内容抖动动画\r\n\t * @property {Boolean} disabled = [] false,是否开启拖动\r\n\t * @property {Boolean} longTap = [] true,是否允许长按启动编辑模式。\r\n\t * @property {Number} model = [0|1] 0,0图标模式,1方块样式。\r\n\t * @property {Array} list = [] [],排序的列表,只要是数组就可,至于内容是什么格式无所谓。\r\n\t * @property {Function} change 拖放排序时触发,返回更改后的列表数据。\r\n\t * @property {Function} remove 删除一个项目时触发。\r\n\t */\r\n\timport tmIcons from '@/tm-vuetify/components/tm-icons/tm-icons.vue';\r\n\timport tmBadges from '@/tm-vuetify/components/tm-badges/tm-badges.vue';\r\n\texport default {\r\n\t\tname:\"tm-dragGrid\",\r\n\t\tcomponents:{tmBadges,tmIcons},\r\n\t\tprops:{\r\n\t\t\t//几列,一行排几个。\r\n\t\t\tcol:{\r\n\t\t\t\ttype:Number,\r\n\t\t\t\tdefault:4\r\n\t\t\t},\r\n\t\t\t//组件宽度,可以不设置默认取父组件宽度\r\n\t\t\twidth:{\r\n\t\t\t\ttype:Number,\r\n\t\t\t\tdefault:0\r\n\t\t\t},\r\n\t\t\t//项目的高度\r\n\t\t\titemHeight:{\r\n\t\t\t\ttype:Number,\r\n\t\t\t\tdefault:120\r\n\t\t\t},\r\n\t\t\t//是否开启拖动显示内容抖动动画\r\n\t\t\tani:{\r\n\t\t\t\ttype:Boolean,\r\n\t\t\t\tdefault:true\r\n\t\t\t},\r\n\t\t\tdisabled: {\r\n\t\t\t\ttype: String | Boolean,\r\n\t\t\t\tdefault: false\r\n\t\t\t},\r\n\t\t\tlist:{\r\n\t\t\t\ttype:Array,\r\n\t\t\t\tdefault:()=>{}\r\n\t\t\t},\r\n\t\t\t//是否开户长按开始编辑。\r\n\t\t\tlongTap:{\r\n\t\t\t\ttype:Boolean,\r\n\t\t\t\tdefault:true\r\n\t\t\t},\r\n\t\t\tmodel:{\r\n\t\t\t\ttype:Number,\r\n\t\t\t\tdefault:0,\r\n\t\t\t}\r\n\t\t},\r\n\t\tdata() {\r\n\t\t\treturn {\r\n\t\t\t\tw:0,\r\n\t\t\t\th:0,\r\n\t\t\t\trow:0,\r\n\t\t\t\ttotalH:0,\r\n\t\t\t\tlistData:[],\r\n\t\t\t\titemWidth:0,\r\n\t\t\t\tendDrage: false,\r\n\t\t\t\tDrage__id: '', //正在被拖动的id;\r\n\t\t\t\tnowMove_index: null, //现在正在移动的索引\r\n\t\t\t\tx:0,\r\n\t\t\t\ty:0,\r\n\t\t\t\tprarentTop:0,\r\n\t\t\t\tprarentLeft:0,\r\n\t\t\t\tgrid:0,\r\n\t\t\t\tisDrage:false,\r\n\t\t\t\t\r\n\t\t\t};\r\n\t\t},\r\n\t\tcomputed:{\r\n\t\t},\r\n\t\tcreated() {\r\n\t\t\tthis.grid = this.list.length;\r\n\t\t},\r\n\t\tmounted() {\r\n\t\t\tthis.inits();\r\n\t\t},\r\n\t\twatch:{\r\n\t\t\tlist:{\r\n\t\t\t\tdeep:true,\r\n\t\t\t\thandler(){\r\n\t\t\t\t\tthis.inits();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t},\r\n\t\tmethods: {\r\n\t\t\tstartEdit(){\r\n\t\t\t\tif(this.longTap==false) return;\r\n\t\t\t\tthis.$emit(\"update:disabled\",false)\r\n\t\t\t},\r\n\t\t\tdelitem(item){\r\n\t\t\t\tthis.list.splice(item.index,1)\r\n\t\t\t\tthis.$emit('remove',item)\r\n\t\t\t\tthis.$emit('change', this.listData);\r\n\t\t\t},\r\n\t\t\tm_start(event,index){\r\n\t\t\t\tevent.preventDefault()\r\n\t\t\t\tevent.stopPropagation()\r\n\t\t\t\tif (this.disabled) return;\r\n\t\t\t\tthis.nowMove_index = index;\r\n\t\t\t\tthis.endDrage = false;\r\n\t\t\t\tthis.isDrage = true;\r\n\t\t\t\tif (event.type.indexOf('mouse') == -1 && event.changedTouches.length == 1) {\r\n\t\t\t\t\tvar touch = event.changedTouches[0];\r\n\t\t\t\t\tthis.y = touch.pageY - event.currentTarget.offsetTop - this.prarentTop\r\n\t\t\t\t\tthis.x = touch.pageX - event.currentTarget.offsetLeft - this.prarentLeft\r\n\t\t\t\t\t\r\n\t\t\t\t} else {\r\n\t\t\t\t\tthis.y = event.pageY - event.currentTarget.offsetTop - this.prarentTop\r\n\t\t\t\t\tthis.x = event.pageX - event.currentTarget.offsetLeft - this.prarentLeft\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t// #ifdef MP\r\n\t\t\t\tuni.vibrateShort({})\r\n\t\t\t\t// #endif\r\n\t\t\t},\r\n\t\t\tm_move(event,index){\r\n\t\t\t\tlet t = this\r\n\t\t\t\tif (this.disabled) return;\r\n\t\t\t\tevent.preventDefault()\r\n\t\t\t\tevent.stopPropagation()\r\n\t\t\t\tif(!this.isDrage) return;\r\n\t\t\t\tif (t.endDrage==true) return;\r\n\t\t\t\t\r\n\t\t\t\t//当前元素的top位置。\r\n\t\t\t\tlet chy = 0;\r\n\t\t\t\tlet chx = 0;\r\n\t\t\t\tif (event.type.indexOf('mouse') == -1 && event.changedTouches.length == 1) {\r\n\t\t\t\t\tvar touch = event.changedTouches[0];\r\n\t\t\t\t\tchy = touch.pageY - t.y - this.prarentTop\r\n\t\t\t\t\tchx = touch.pageX - t.x - this.prarentLeft\r\n\t\t\t\t\r\n\t\t\t\t} else {\r\n\t\t\t\t\tchy = event.pageY - t.y - this.prarentTop\r\n\t\t\t\t\tchx = event.pageX - t.x - this.prarentLeft\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tt.listData.splice(index, 1, {\r\n\t\t\t\t\t...t.listData[index],\r\n\t\t\t\t\ttop: chy,\r\n\t\t\t\t\tleft: chx,\r\n\t\t\t\t})\r\n\t\t\t\tt.nowMove_index = index;\r\n\t\t\t\t\r\n\t\t\t\tconst currenit_index = index;\r\n\t\t\t\tconst currentSort = t.listData[currenit_index].sort;\r\n\t\t\t\tconst currenit_id = t.listData[currenit_index].__id;\r\n\t\t\t\t\r\n\t\t\t\t// 计算当前移动的index.\r\n\t\t\t\tlet moveIndex = Math.round(chx / t.itemWidth) + Math.round(chy / t.h)*t.col;\r\n\t\t\t\t\r\n\t\t\t\tmoveIndex = moveIndex < 0 ? 0 : moveIndex;\r\n\t\t\t\tmoveIndex = moveIndex > t.listData.length - 1 ? t.listData.length - 1 : moveIndex;\r\n\t\t\t\t\r\n\t\t\t\tmoveIndex = Math.abs(moveIndex)\r\n\t\t\t\t\r\n\t\t\t\tindex = moveIndex;\r\n\t\t\t\tlet elList = [...t.listData]\r\n\t\t\t\tfor (let i = 0; i < elList.length; i++) {\r\n\t\t\t\t\tif (currentSort < moveIndex) {\r\n\t\t\t\t\t\tif (elList[i].sort > currentSort && elList[i].sort <= moveIndex) {\r\n\t\t\t\t\t\t\telList[i].sort -= 1;\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t} else if (currentSort > moveIndex) {\r\n\t\t\t\t\t\tif (elList[i].sort < currentSort && elList[i].sort >= moveIndex) {\r\n\t\t\t\t\t\t\telList[i].sort += 1;\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t}\r\n\t\t\t\t};\r\n\t\t\t\telList[currenit_index].sort = moveIndex;\r\n\t\t\t\telList = elList.map(el => {\r\n\t\t\t\t\tif (el.__id != currenit_id) {\r\n\t\t\t\t\t\tel.left = el.sort % t.col * t.itemWidth;\r\n\t\t\t\t\t\tel.top = parseInt(el.sort / t.col) * t.h;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn el;\r\n\t\t\t\t})\r\n\t\t\t\tt.listData = elList;\r\n\t\t\t\r\n\t\t\t},\r\n\t\t\tm_end(event,index){\r\n\t\t\t\t\r\n\t\t\t\tif (this.disabled) return;\r\n\t\t\t\tlet t = this;\r\n\t\t\t\tevent.preventDefault()\r\n\t\t\t\tevent.stopPropagation()\r\n\t\t\t\tthis.isDrage = false;\r\n\t\t\t\tthis.endDrage = true;\r\n\t\t\t\tif (this.nowMove_index == null) return;\r\n\t\t\t\tlet elList = [...t.listData]\r\n\t\t\t\telList = this.setTL(elList);\r\n\t\t\t\telList.sort((a,b)=>a.sort-b.sort)\r\n\t\t\t\tt.listData = [...elList]\r\n\t\t\t\tthis.nowMove_index = null;\r\n\t\t\t\tthis.moveChange();\r\n\t\t\t},\r\n\t\t\tmoveChange(e, index) {\r\n\t\t\t\tif (this.disabled) return;\r\n\t\t\t\t//change后修改的数据 。\r\n\t\t\t\tconst elList = [...this.listData]\r\n\t\t\t\telList.sort((a,b)=>a.sort-b.sort-b)\r\n\t\t\t\tthis.$emit('change',elList);\r\n\t\t\t},\r\n\t\t\tinits() {\r\n\t\t\t\tif(this.grid==0) return;\r\n\t\t\t\tthis.$nextTick(async function() {\r\n\t\t\t\t\tlet p = await this.$Querey(\".tm-dragGrid\", this).catch(e => {})\r\n\t\t\t\t\tthis.grid = this.list.length;\r\n\t\t\t\t\tthis.listData = [];\r\n\t\t\t\t\t//组件的宽度\r\n\t\t\t\t\tthis.w = uni.upx2px(this.width) || p[0].width || 300;\r\n\t\t\t\t\tthis.prarentTop = p[0].top;\r\n\t\t\t\t\tthis.prarentLeft = p[0].left;\r\n\t\t\t\t\t\r\n\t\t\t\t\t//项目的高度。\r\n\t\t\t\t\tthis.h = uni.upx2px(this.itemHeight)\r\n\t\t\t\t\t//项目的宽度\r\n\t\t\t\t\tthis.itemWidth = this.w / this.col\r\n\t\t\t\t\t//行数。\r\n\t\t\t\t\tthis.row = Math.ceil(this.grid / this.col);\r\n\t\t\t\t\t\r\n\t\t\t\t\t//总高度\r\n\t\t\t\t\tthis.totalH = this.h * this.row\r\n\t\t\t\t\t//构造一个list宫格列表出来。\r\n\t\t\t\t\tfor(let i=0;i<this.grid;i++){\r\n\t\t\t\t\t\tthis.listData.push({\r\n\t\t\t\t\t\t\t\"data\":this.list[i],\r\n\t\t\t\t\t\t\t\"__id\":uni.$tm.guid(),\r\n\t\t\t\t\t\t\t\"top\":0,\r\n\t\t\t\t\t\t\t\"left\":0,\r\n\t\t\t\t\t\t\t\"sort\":i,\r\n\t\t\t\t\t\t\t\"index\":i\r\n\t\t\t\t\t\t})\r\n\t\t\t\t\t}\r\n\t\t\t\t\tlet list = this.setTL([...this.listData]);\r\n\t\t\t\t\tthis.listData = [...list];\r\n\t\t\t\t})\r\n\t\t\t},\r\n\t\t\t//计算位置。\r\n\t\t\tsetTL(el){\r\n\t\t\t\tfor(let i = 0;i < el.length;i++){\r\n\t\t\t\t\tel[i].left = el[i].sort % this.col * this.itemWidth;\r\n\t\t\t\t\tel[i].top = parseInt(el[i].sort / this.col) * this.h;\r\n\t\t\t\t}\r\n\t\t\t\treturn el;\r\n\t\t\t}\r\n\t\t},\r\n\t}\r\n</script>\r\n\r\n<style lang=\"scss\" scoped>\r\n\t.aniOn{\r\n\t\tanimation:doudong 0.5s linear infinite;\r\n\t\tbackground:linear-gradient();\r\n\t\tbackground: -webkit-linear-gradient();\r\n\t\t\r\n\t}\r\n\t.tranAni{\r\n\t\ttransition:all 0.15s\r\n\t}\r\n\t@keyframes doudong {\r\n\t\t0%{\r\n\t\t\ttransform: rotate(-2deg) translateX(2rpx) translateY(2rpx);\r\n\t\t}\r\n\t\t25%{\r\n\t\t\ttransform: rotate(0deg) translateX(-2rpx) translateY(-2rpx);\r\n\t\t}\r\n\t\t50%{\r\n\t\t\ttransform: rotate(0deg) translateX(0rpx) translateY(-2rpx);\r\n\t\t}\r\n\t\t75%{\r\n\t\t\ttransform: rotate(0deg) translateX(0rpx) translateY(2rpx);\r\n\t\t}\r\n\t\t100%{\r\n\t\t\ttransform: rotate(-2deg) translateX(2rpx) translateY(2rpx);\r\n\t\t}\r\n\t}\r\n</style>\r\n","import mod from \"-!../../../../../exe/HBuilderX.3.4.7.20220422/HBuilderX/plugins/uniapp-cli/node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../../../exe/HBuilderX.3.4.7.20220422/HBuilderX/plugins/uniapp-cli/node_modules/css-loader/dist/cjs.js??ref--8-oneOf-1-1!../../../../../exe/HBuilderX.3.4.7.20220422/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/stylePostLoader.js!../../../../../exe/HBuilderX.3.4.7.20220422/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--8-oneOf-1-2!../../../../../exe/HBuilderX.3.4.7.20220422/HBuilderX/plugins/uniapp-cli/node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-3!../../../../../exe/HBuilderX.3.4.7.20220422/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/sass-loader/dist/cjs.js??ref--8-oneOf-1-4!../../../../../exe/HBuilderX.3.4.7.20220422/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--8-oneOf-1-5!../../../../../exe/HBuilderX.3.4.7.20220422/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/index.js??vue-loader-options!../../../../../exe/HBuilderX.3.4.7.20220422/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./tm-dragGrid.vue?vue&type=style&index=0&id=2ab2a82b&lang=scss&scoped=true&\"; export default mod; export * from \"-!../../../../../exe/HBuilderX.3.4.7.20220422/HBuilderX/plugins/uniapp-cli/node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../../../exe/HBuilderX.3.4.7.20220422/HBuilderX/plugins/uniapp-cli/node_modules/css-loader/dist/cjs.js??ref--8-oneOf-1-1!../../../../../exe/HBuilderX.3.4.7.20220422/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/stylePostLoader.js!../../../../../exe/HBuilderX.3.4.7.20220422/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--8-oneOf-1-2!../../../../../exe/HBuilderX.3.4.7.20220422/HBuilderX/plugins/uniapp-cli/node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-3!../../../../../exe/HBuilderX.3.4.7.20220422/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/sass-loader/dist/cjs.js??ref--8-oneOf-1-4!../../../../../exe/HBuilderX.3.4.7.20220422/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--8-oneOf-1-5!../../../../../exe/HBuilderX.3.4.7.20220422/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/index.js??vue-loader-options!../../../../../exe/HBuilderX.3.4.7.20220422/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./tm-dragGrid.vue?vue&type=style&index=0&id=2ab2a82b&lang=scss&scoped=true&\"","// extracted by mini-css-extract-plugin\n if(module.hot) {\n // 1678780470248\n var cssReload = require(\"D:/yzm/exe/HBuilderX.3.4.7.20220422/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":""}
|