uni-mall-head.js 4.5 KB

1234567891011
  1. (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["components/uni-mall-head/uni-mall-head"],{606:function(t,n,e){"use strict";e.r(n);var r=e(607),i=e(609);for(var a in i)["default"].indexOf(a)<0&&function(t){e.d(n,t,(function(){return i[t]}))}(a);e(611);var u,c=e(32),o=Object(c["default"])(i["default"],r["render"],r["staticRenderFns"],!1,null,null,null,!1,r["components"],u);o.options.__file="components/uni-mall-head/uni-mall-head.vue",n["default"]=o.exports},607:function(t,n,e){"use strict";e.r(n);var r=e(608);e.d(n,"render",(function(){return r["render"]})),e.d(n,"staticRenderFns",(function(){return r["staticRenderFns"]})),e.d(n,"recyclableRender",(function(){return r["recyclableRender"]})),e.d(n,"components",(function(){return r["components"]}))},608:function(t,n,e){"use strict";var r;e.r(n),e.d(n,"render",(function(){return i})),e.d(n,"staticRenderFns",(function(){return u})),e.d(n,"recyclableRender",(function(){return a})),e.d(n,"components",(function(){return r}));try{r={uniIcons:function(){return Promise.all([e.e("common/vendor"),e.e("uni_modules/uni-icons/components/uni-icons/uni-icons")]).then(e.bind(null,376))}}}catch(c){if(-1===c.message.indexOf("Cannot find module")||-1===c.message.indexOf(".vue"))throw c;console.error(c.message),console.error("1. 排查组件名称拼写是否正确"),console.error("2. 排查组件是否符合 easycom 规范,文档:https://uniapp.dcloud.net.cn/collocation/pages?id=easycom"),console.error("3. 若组件不符合 easycom 规范,需手动引入,并在 components 中注册该组件")}var i=function(){var t=this,n=t.$createElement,e=(t._self._c,t.tabs.length);t.$mp.data=Object.assign({},{$root:{g0:e}})},a=!1,u=[];i._withStripped=!0},609:function(t,n,e){"use strict";e.r(n);var r=e(610),i=e.n(r);for(var a in r)["default"].indexOf(a)<0&&function(t){e.d(n,t,(function(){return r[t]}))}(a);n["default"]=i.a},610:function(t,n,e){"use strict";(function(t){var r=e(4);Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var i=r(e(164)),a=r(e(166)),u={data:function(){return{tabs:[],viewId:"id_"+Math.random().toString(36).substr(2,16),scrollLeft:0,warpWidth:0}},computed:{isScroll:function(){return this.tabWidth&&this.tabs.length},tabHeightPx:function(){return t.upx2px(this.height)},tabHeightVal:function(){return"48px"},tabWidthPx:function(){return t.upx2px(this.tabWidth)},tabWidthVal:function(){return this.isScroll?this.tabWidthPx+"px":""},lineLeft:function(){return this.isScroll?this.tabWidthPx*this.value+this.tabWidthPx/2+"px":100/this.tabs.length*(this.value+1)-100/(2*this.tabs.length)+"%"}},watch:{value:function(){this.scrollCenter()}},methods:{tabClick:function(t){this.tabs.splice(t+1,this.tabs.length),this.$emit("change",this.tabs[t])},addTab:function(n){var e=this;return(0,a.default)(i.default.mark((function r(){return i.default.wrap((function(r){while(1)switch(r.prev=r.next){case 0:e.tabs.push(n),setTimeout((function(){var n=t.createSelectorQuery();n=n.in(e),n.select(".tab-item").boundingClientRect((function(t){e.warpWidth+=t.width,e.scrollLeft=e.warpWidth})).exec()}),100);case 2:case"end":return r.stop()}}),r)})))()},scrollCenter:function(){var n=this;return(0,a.default)(i.default.mark((function e(){var r,a,u;return i.default.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(n.isScroll){e.next=2;break}return e.abrupt("return");case 2:if(n.warpWidth){e.next=7;break}return e.next=5,n.initWarpRect();case 5:r=e.sent,n.warpWidth=r?r.width:t.getSystemInfoSync().windowWidth;case 7:a=n.tabWidthPx*n.value+n.tabWidthPx/2,u=a-n.warpWidth/2,n.scrollLeft=u;case 10:case"end":return e.stop()}}),e)})))()},initWarpRect:function(){var n=this;return new Promise((function(e){setTimeout((function(){var r=t.createSelectorQuery();r=r.in(n),r.select("#"+n.viewId).boundingClientRect((function(t){e(t)})).exec()}),20)}))}},mounted:function(){this.scrollCenter()}};n.default=u}).call(this,e(2)["default"])},611:function(t,n,e){"use strict";e.r(n);var r=e(612),i=e.n(r);for(var a in r)["default"].indexOf(a)<0&&function(t){e.d(n,t,(function(){return r[t]}))}(a);n["default"]=i.a},612:function(t,n,e){}}]);
  2. //# sourceMappingURL=../../../.sourcemap/mp-weixin/components/uni-mall-head/uni-mall-head.js.map
  3. ;(global["webpackJsonp"] = global["webpackJsonp"] || []).push([
  4. 'components/uni-mall-head/uni-mall-head-create-component',
  5. {
  6. 'components/uni-mall-head/uni-mall-head-create-component':(function(module, exports, __webpack_require__){
  7. __webpack_require__('2')['createComponent'](__webpack_require__(606))
  8. })
  9. },
  10. [['components/uni-mall-head/uni-mall-head-create-component']]
  11. ]);