text: (function(t,e){"object"===typeof exports&&"object"===typeof module?module.exports=e():"function"===typeof define&&define.amd?define([],e):"object"===typeof exports?exports["vue-scroll-tab"]=e():t["vue-scroll-tab"]=e()})("undefined"!==typeof self?self:this,function(){return function(t){var e={};function n(o){if(e[o])return e[o].exports;var i=e[o]={i:o,l:!1,exports:{}};return t[o].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,o){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:o})},n.n=function(t){var e=t&&t.__esModule?function(){return t["default"]}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="./",n(n.s=0)}({0:function(t,e,n){t.exports=n("bGai")},bGai:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o={name:"ScrollTab",data:function(){return{wrapWidth:1e5,itemInfos:[]}},mounted:function(){this.fixWidth()},methods:{active:function(t){var e=this.itemInfos[t],n=e.left+e.width/2-this.$refs.sTab.offsetWidth/2;this.smoothScroll(n)},fixWidth:function(){var t=this;this.$nextTick(function(){if(t.$slots.default){t.positionList=[];var e=0;t.$slots.default.forEach(function(n,o){var i=n.elm,r=i.getBoundingClientRect();t.itemInfos.push({left:e,width:r.width,index:o}),e+=r.width}),t.wrapWidth=e}})},smoothScroll:function(t){var e=this,n=this.$refs.sTab,o=n.scrollLeft,i=t-o>0?"bottom":"top";this.scrolling=!0;var r=setInterval(function(){if(Math.abs(o-t)<=20)clearInterval(r),n.scrollLeft=t,e.scrolling=!1;else{var s=(t-o)/3;s=Math.abs(s)>20?s:"bottom"===i?20:-20,o+=s,n.scrollLeft=o}},16.7)}}},i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{ref:"sTab",staticClass:"sTab"},[n("div",{staticClass:"sTabWrap",style:{width:t.wrapWidth+"px"}},[t._t("default")],2)])},r=[];function s(t,e,n,o,i,r,s,l){t=t||{};var a=typeof t.default;"object"!==a&&"function"!==a||(t=t.default);var c,f="function"===typeof t?t.options:t;if(e&&(f.render=e,f.staticRenderFns=n,f._compiled=!0),o&&(f.functional=!0),r&&(f._scopeId=r),s?(c=function(t){t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,t||"undefined"===typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),i&&i.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(s)},f._ssrRegister=c):i&&(c=l?function(){i.call(this,this.$root.$options.shadowRoot)}:i),c)if(f.functional){f._injectStyles=c;var u=f.render;f.render=function(t,e){return c.call(e),u(t,e)}}else{var d=f.beforeCreate;f.beforeCreate=d?[].concat(d,c):[c]}return{exports:t,options:f}}function l(t){n("jIE1")}var a=!1,c=l,f=null,u=null,d=s(o,i,r,a,c,f,u),p=d.exports,h={name:"ScrollTabItem",props:{index:{type:Number,default:0}},methods:{click:function(){this.$parent.active(this.index)}}},v=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"ScrollTabItem",on:{click:t.click}},[t._t("default")],2)},m=[],b=!1,_=null,x=null,y=null,T=s(h,v,m,b,_,x,y),$=T.exports;function C(t){t.component(p.name,p),t.component($.name,$)}p.install=C;e["default"]={ScrollTab:p,ScrollTabItem:$}},jIE1:function(t,e){}})["default"]});
  //# sourceMappingURL=vue-scroll-tab.umd.min.js.map