├── README.md ├── dist ├── build.js └── build.js.map ├── index.html ├── package.json ├── src ├── main.js ├── main.vue └── slider.vue └── webpack.config.js /README.md: -------------------------------------------------------------------------------- 1 | # Vue Slider 2 | 3 | > Слайдер контента для Vue.js 4 | 5 | - [Демо](https://featurum.github.io/vue-slider/) 6 | 7 | ## Установка 8 | 9 | ``` bash 10 | 11 | cd example/ 12 | 13 | # Установка зависимостей 14 | npm install 15 | 16 | # Запуск сервера (localhost:8080) 17 | npm run dev 18 | 19 | # Билд 20 | npm run build 21 | ``` 22 | 23 | ## Опции 24 | 25 | | Параметры | Тип | По умолчанию | Описание | 26 | | ----------- |:--------------| ---------|--------------| 27 | | items | Number | 3 | Количество слайдов | 28 | | margin | Number | 20 | Дистанция между слайдами | 29 | | nav | Boolean | false | Навигация | 30 | | dots | Boolean | false | Точечная навигация | 31 | | loop | Boolean | false | Бесконечная прокрутка | 32 | | prevNav | String | | Кнопка назад | 33 | | nextNav | String | | Кнопка веред | 34 | | speed | Number | 300 | Скорость перелистывания (мс) | 35 | | timing | String | 'ease' | Анимация перехода (linear, ease-in, ease-out, ease-in-out) | 36 | | offset | Number | 1 | Количество смещаемых слайдов | 37 | | sibling | Boolean | false | Переключение слайдов соседними блоками | 38 | | responsive | Object | {} | Отзывчивость | 39 | 40 | 41 | ## Пример подключения 42 | 43 | ```html 44 | 53 | 88 | ``` 89 | -------------------------------------------------------------------------------- /dist/build.js: -------------------------------------------------------------------------------- 1 | !function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var n={};e.m=t,e.c=n,e.i=function(t){return t},e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="/dist/",e(e.s=8)}([function(t,e){t.exports=function(){var t=[];return t.toString=function(){for(var t=[],e=0;en.parts.length&&(r.parts.length=n.parts.length)}else{for(var a=[],i=0;i=0&&Math.floor(e)===e&&isFinite(t)}function d(t){return null==t?"":"object"==typeof t?JSON.stringify(t,null,2):String(t)}function p(t){var e=parseFloat(t);return isNaN(e)?t:e}function v(t,e){for(var n=Object.create(null),r=t.split(","),i=0;i-1)return t.splice(n,1)}}function m(t,e){return ro.call(t,e)}function g(t){var e=Object.create(null);return function(n){return e[n]||(e[n]=t(n))}}function y(t,e){function n(n){var r=arguments.length;return r?r>1?t.apply(e,arguments):t.call(e,n):t.call(e)}return n._length=t.length,n}function _(t,e){e=e||0;for(var n=t.length-e,r=new Array(n);n--;)r[n]=t[n+e];return r}function b(t,e){for(var n in e)t[n]=e[n];return t}function w(t){for(var e={},n=0;n0&&(a=ht(a,(e||"")+"_"+n),vt(a[0])&&vt(l)&&(u[c]=M(l.text+a[0].text),a.shift()),u.push.apply(u,a)):s(a)?vt(l)?u[c]=M(l.text+a):""!==a&&u.push(M(a)):vt(a)&&vt(l)?u[c]=M(l.text+a.text):(o(t._isVList)&&i(a.tag)&&r(a.key)&&i(e)&&(a.key="__vlist"+e+"_"+n+"__"),u.push(a)));return u}function mt(t,e){return(t.__esModule||Lo&&"Module"===t[Symbol.toStringTag])&&(t=t.default),c(t)?e.extend(t):t}function gt(t,e,n,r,i){var o=Bo();return o.asyncFactory=t,o.asyncMeta={data:e,context:n,children:r,tag:i},o}function yt(t,e,n){if(o(t.error)&&i(t.errorComp))return t.errorComp;if(i(t.resolved))return t.resolved;if(o(t.loading)&&i(t.loadingComp))return t.loadingComp;if(!i(t.contexts)){var a=t.contexts=[n],s=!0,l=function(){for(var t=0,e=a.length;tua&&oa[n].id>t.id;)n--;oa.splice(n+1,0,t)}else oa.push(t);ca||(ca=!0,at(jt))}}function Ut(t){pa.clear(),Ht(t,pa)}function Ht(t,e){var n,r,i=Array.isArray(t);if((i||c(t))&&Object.isExtensible(t)){if(t.__ob__){var o=t.__ob__.dep.id;if(e.has(o))return;e.add(o)}if(i)for(n=t.length;n--;)Ht(t[n],e);else for(r=Object.keys(t),n=r.length;n--;)Ht(t[r[n]],e)}}function zt(t,e,n){va.get=function(){return this[e][n]},va.set=function(t){this[e][n]=t},Object.defineProperty(t,n,va)}function Vt(t){t._watchers=[];var e=t.$options;e.props&&Wt(t,e.props),e.methods&&Gt(t,e.methods),e.data?Kt(t):R(t._data={},!0),e.computed&&qt(t,e.computed),e.watch&&e.watch!==Ao&&Zt(t,e.watch)}function Wt(t,e){var n=t.$options.propsData||{},r=t._props={},i=t.$options._propKeys=[],o=!t.$parent;Vo.shouldConvert=o;for(var a in e)!function(o){i.push(o);var a=G(o,e,n,t);P(r,o,a),o in t||zt(t,"_props",o)}(a);Vo.shouldConvert=!0}function Kt(t){var e=t.$options.data;e=t._data="function"==typeof e?Jt(e,t):e||{},l(e)||(e={});for(var n=Object.keys(e),r=t.$options.props,i=(t.$options.methods,n.length);i--;){var o=n[i];r&&m(r,o)||A(o)||zt(t,"_data",o)}R(e,!0)}function Jt(t,e){try{return t.call(e,e)}catch(t){return et(t,e,"data()"),{}}}function qt(t,e){var n=t._computedWatchers=Object.create(null),r=Io();for(var i in e){var o=e[i],a="function"==typeof o?o:o.get;r||(n[i]=new da(t,a||x,x,ha)),i in t||Xt(t,i,o)}}function Xt(t,e,n){var r=!Io();"function"==typeof n?(va.get=r?Yt(e):n,va.set=x):(va.get=n.get?r&&!1!==n.cache?Yt(e):n.get:x,va.set=n.set?n.set:x),Object.defineProperty(t,e,va)}function Yt(t){return function(){var e=this._computedWatchers&&this._computedWatchers[t];if(e)return e.dirty&&e.evaluate(),jo.target&&e.depend(),e.value}}function Gt(t,e){t.$options.props;for(var n in e)t[n]=null==e[n]?x:y(e[n],t)}function Zt(t,e){for(var n in e){var r=e[n];if(Array.isArray(r))for(var i=0;i=0||n.indexOf(t[i])<0)&&r.push(t[i]);return r}return t}function Ee(t){this._init(t)}function Ie(t){t.use=function(t){var e=this._installedPlugins||(this._installedPlugins=[]);if(e.indexOf(t)>-1)return this;var n=_(arguments,1);return n.unshift(this),"function"==typeof t.install?t.install.apply(t,n):"function"==typeof t&&t.apply(null,n),e.push(t),this}}function Me(t){t.mixin=function(t){return this.options=X(this.options,t),this}}function Le(t){t.cid=0;var e=1;t.extend=function(t){t=t||{};var n=this,r=n.cid,i=t._Ctor||(t._Ctor={});if(i[r])return i[r];var o=t.name||n.options.name,a=function(t){this._init(t)};return a.prototype=Object.create(n.prototype),a.prototype.constructor=a,a.cid=e++,a.options=X(n.options,t),a.super=n,a.options.props&&Ne(a),a.options.computed&&De(a),a.extend=n.extend,a.mixin=n.mixin,a.use=n.use,po.forEach(function(t){a[t]=n[t]}),o&&(a.options.components[o]=a),a.superOptions=n.options,a.extendOptions=t,a.sealedOptions=b({},a.options),i[r]=a,a}}function Ne(t){var e=t.options.props;for(var n in e)zt(t.prototype,"_props",n)}function De(t){var e=t.options.computed;for(var n in e)Xt(t.prototype,n,e[n])}function je(t){po.forEach(function(e){t[e]=function(t,n){return n?("component"===e&&l(n)&&(n.name=n.name||t,n=this.options._base.extend(n)),"directive"===e&&"function"==typeof n&&(n={bind:n,update:n}),this.options[e+"s"][t]=n,n):this.options[e+"s"][t]}})}function Re(t){return t&&(t.Ctor.options.name||t.tag)}function Pe(t,e){return Array.isArray(t)?t.indexOf(e)>-1:"string"==typeof t?t.split(",").indexOf(e)>-1:!!u(t)&&t.test(e)}function Fe(t,e){var n=t.cache,r=t.keys,i=t._vnode;for(var o in n){var a=n[o];if(a){var s=Re(a.componentOptions);s&&!e(s)&&Be(n,o,r,i)}}}function Be(t,e,n,r){var i=t[e];i&&i!==r&&i.componentInstance.$destroy(),t[e]=null,h(n,e)}function Ue(t){for(var e=t.data,n=t,r=t;i(r.componentInstance);)r=r.componentInstance._vnode,r.data&&(e=He(r.data,e));for(;i(n=n.parent);)n.data&&(e=He(e,n.data));return ze(e.staticClass,e.class)}function He(t,e){return{staticClass:Ve(t.staticClass,e.staticClass),class:i(t.class)?[t.class,e.class]:e.class}}function ze(t,e){return i(t)||i(e)?Ve(t,We(e)):""}function Ve(t,e){return t?e?t+" "+e:t:e||""}function We(t){return Array.isArray(t)?Ke(t):c(t)?Je(t):"string"==typeof t?t:""}function Ke(t){for(var e,n="",r=0,o=t.length;r-1?Ja[t]=e.constructor===window.HTMLUnknownElement||e.constructor===window.HTMLElement:Ja[t]=/HTMLUnknownElement/.test(e.toString())}function Ye(t){if("string"==typeof t){var e=document.querySelector(t);return e||document.createElement("div")}return t}function Ge(t,e){var n=document.createElement(t);return"select"!==t?n:(e.data&&e.data.attrs&&void 0!==e.data.attrs.multiple&&n.setAttribute("multiple","multiple"),n)}function Ze(t,e){return document.createElementNS(Ha[t],e)}function Qe(t){return document.createTextNode(t)}function tn(t){return document.createComment(t)}function en(t,e,n){t.insertBefore(e,n)}function nn(t,e){t.removeChild(e)}function rn(t,e){t.appendChild(e)}function on(t){return t.parentNode}function an(t){return t.nextSibling}function sn(t){return t.tagName}function cn(t,e){t.textContent=e}function ln(t,e,n){t.setAttribute(e,n)}function un(t,e){var n=t.data.ref;if(n){var r=t.context,i=t.componentInstance||t.elm,o=r.$refs;e?Array.isArray(o[n])?h(o[n],i):o[n]===i&&(o[n]=void 0):t.data.refInFor?Array.isArray(o[n])?o[n].indexOf(i)<0&&o[n].push(i):o[n]=[i]:o[n]=i}}function fn(t,e){return t.key===e.key&&(t.tag===e.tag&&t.isComment===e.isComment&&i(t.data)===i(e.data)&&dn(t,e)||o(t.isAsyncPlaceholder)&&t.asyncFactory===e.asyncFactory&&r(e.asyncFactory.error))}function dn(t,e){if("input"!==t.tag)return!0;var n,r=i(n=t.data)&&i(n=n.attrs)&&n.type,o=i(n=e.data)&&i(n=n.attrs)&&n.type;return r===o||qa(r)&&qa(o)}function pn(t,e,n){var r,o,a={};for(r=e;r<=n;++r)o=t[r].key,i(o)&&(a[o]=r);return a}function vn(t,e){(t.data.directives||e.data.directives)&&hn(t,e)}function hn(t,e){var n,r,i,o=t===Ga,a=e===Ga,s=mn(t.data.directives,t.context),c=mn(e.data.directives,e.context),l=[],u=[];for(n in c)r=s[n],i=c[n],r?(i.oldValue=r.value,yn(i,"update",e,t),i.def&&i.def.componentUpdated&&u.push(i)):(yn(i,"bind",e,t),i.def&&i.def.inserted&&l.push(i));if(l.length){var f=function(){for(var n=0;n=0&&" "===(m=t.charAt(h));h--);m&&is.test(m)||(u=!0)}}else void 0===o?(v=i+1,o=t.slice(0,i).trim()):e();if(void 0===o?o=t.slice(0,i).trim():0!==v&&e(),a)for(i=0;i-1?{exp:t.slice(0,Oa),key:'"'+t.slice(Oa+1)+'"'}:{exp:t,key:null};for(ka=t,Oa=Sa=Ta=0;!jn();)Aa=Dn(),Rn(Aa)?Fn(Aa):91===Aa&&Pn(Aa);return{exp:t.slice(0,Sa),key:t.slice(Sa+1,Ta)}}function Dn(){return ka.charCodeAt(++Oa)}function jn(){return Oa>=Ca}function Rn(t){return 34===t||39===t}function Pn(t){var e=1;for(Sa=Oa;!jn();)if(t=Dn(),Rn(t))Fn(t);else if(91===t&&e++,93===t&&e--,0===e){Ta=Oa;break}}function Fn(t){for(var e=t;!jn()&&(t=Dn())!==e;);}function Bn(t,e,n){Ea=n;var r=e.value,i=e.modifiers,o=t.tag,a=t.attrsMap.type;if(t.component)return Mn(t,r,i),!1;if("select"===o)zn(t,r,i);else if("input"===o&&"checkbox"===a)Un(t,r,i);else if("input"===o&&"radio"===a)Hn(t,r,i);else if("input"===o||"textarea"===o)Vn(t,r,i);else if(!ho.isReservedTag(o))return Mn(t,r,i),!1;return!0}function Un(t,e,n){var r=n&&n.number,i=En(t,"value")||"null",o=En(t,"true-value")||"true",a=En(t,"false-value")||"false";An(t,"checked","Array.isArray("+e+")?_i("+e+","+i+")>-1"+("true"===o?":("+e+")":":_q("+e+","+o+")")),Tn(t,"change","var $$a="+e+",$$el=$event.target,$$c=$$el.checked?("+o+"):("+a+");if(Array.isArray($$a)){var $$v="+(r?"_n("+i+")":i)+",$$i=_i($$a,$$v);if($$el.checked){$$i<0&&("+e+"=$$a.concat([$$v]))}else{$$i>-1&&("+e+"=$$a.slice(0,$$i).concat($$a.slice($$i+1)))}}else{"+Ln(e,"$$c")+"}",null,!0)}function Hn(t,e,n){var r=n&&n.number,i=En(t,"value")||"null";i=r?"_n("+i+")":i,An(t,"checked","_q("+e+","+i+")"),Tn(t,"change",Ln(e,i),null,!0)}function zn(t,e,n){var r=n&&n.number,i='Array.prototype.filter.call($event.target.options,function(o){return o.selected}).map(function(o){var val = "_value" in o ? o._value : o.value;return '+(r?"_n(val)":"val")+"})",o="var $$selectedVal = "+i+";";o=o+" "+Ln(e,"$event.target.multiple ? $$selectedVal : $$selectedVal[0]"),Tn(t,"change",o,null,!0)}function Vn(t,e,n){var r=t.attrsMap.type,i=n||{},o=i.lazy,a=i.number,s=i.trim,c=!o&&"range"!==r,l=o?"change":"range"===r?os:"input",u="$event.target.value";s&&(u="$event.target.value.trim()"),a&&(u="_n("+u+")");var f=Ln(e,u);c&&(f="if($event.target.composing)return;"+f),An(t,"value","("+e+")"),Tn(t,l,f,null,!0),(s||a)&&Tn(t,"blur","$forceUpdate()")}function Wn(t){if(i(t[os])){var e=wo?"change":"input";t[e]=[].concat(t[os],t[e]||[]),delete t[os]}i(t[as])&&(t.change=[].concat(t[as],t.change||[]),delete t[as])}function Kn(t,e,n){var r=Ia;return function i(){null!==t.apply(null,arguments)&&qn(e,i,n,r)}}function Jn(t,e,n,r,i){e=ot(e),n&&(e=Kn(e,t,r)),Ia.addEventListener(t,e,Oo?{capture:r,passive:i}:r)}function qn(t,e,n,r){(r||Ia).removeEventListener(t,e._withTask||e,n)}function Xn(t,e){if(!r(t.data.on)||!r(e.data.on)){var n=e.data.on||{},i=t.data.on||{};Ia=e.elm,Wn(n),ct(n,i,Jn,qn,e.context),Ia=void 0}}function Yn(t,e){if(!r(t.data.domProps)||!r(e.data.domProps)){var n,o,a=e.elm,s=t.data.domProps||{},c=e.data.domProps||{};i(c.__ob__)&&(c=e.data.domProps=b({},c));for(n in s)r(c[n])&&(a[n]="");for(n in c){if(o=c[n],"textContent"===n||"innerHTML"===n){if(e.children&&(e.children.length=0),o===s[n])continue;1===a.childNodes.length&&a.removeChild(a.childNodes[0])}if("value"===n){a._value=o;var l=r(o)?"":String(o);Gn(a,l)&&(a.value=l)}else a[n]=o}}}function Gn(t,e){return!t.composing&&("OPTION"===t.tagName||Zn(t,e)||Qn(t,e))}function Zn(t,e){var n=!0;try{n=document.activeElement!==t}catch(t){}return n&&t.value!==e}function Qn(t,e){var n=t.value,r=t._vModifiers;return i(r)&&r.number?p(n)!==p(e):i(r)&&r.trim?n.trim()!==e.trim():n!==e}function tr(t){var e=er(t.style);return t.staticStyle?b(t.staticStyle,e):e}function er(t){return Array.isArray(t)?w(t):"string"==typeof t?ls(t):t}function nr(t,e){var n,r={};if(e)for(var i=t;i.componentInstance;)i=i.componentInstance._vnode,i.data&&(n=tr(i.data))&&b(r,n);(n=tr(t.data))&&b(r,n);for(var o=t;o=o.parent;)o.data&&(n=tr(o.data))&&b(r,n);return r}function rr(t,e){var n=e.data,o=t.data;if(!(r(n.staticStyle)&&r(n.style)&&r(o.staticStyle)&&r(o.style))){var a,s,c=e.elm,l=o.staticStyle,u=o.normalizedStyle||o.style||{},f=l||u,d=er(e.data.style)||{};e.data.normalizedStyle=i(d.__ob__)?b({},d):d;var p=nr(e,!0);for(s in f)r(p[s])&&ds(c,s,"");for(s in p)(a=p[s])!==f[s]&&ds(c,s,null==a?"":a)}}function ir(t,e){if(e&&(e=e.trim()))if(t.classList)e.indexOf(" ")>-1?e.split(/\s+/).forEach(function(e){return t.classList.add(e)}):t.classList.add(e);else{var n=" "+(t.getAttribute("class")||"")+" ";n.indexOf(" "+e+" ")<0&&t.setAttribute("class",(n+e).trim())}}function or(t,e){if(e&&(e=e.trim()))if(t.classList)e.indexOf(" ")>-1?e.split(/\s+/).forEach(function(e){return t.classList.remove(e)}):t.classList.remove(e),t.classList.length||t.removeAttribute("class");else{for(var n=" "+(t.getAttribute("class")||"")+" ",r=" "+e+" ";n.indexOf(r)>=0;)n=n.replace(r," ");n=n.trim(),n?t.setAttribute("class",n):t.removeAttribute("class")}}function ar(t){if(t){if("object"==typeof t){var e={};return!1!==t.css&&b(e,ms(t.name||"v")),b(e,t),e}return"string"==typeof t?ms(t):void 0}}function sr(t){Cs(function(){Cs(t)})}function cr(t,e){var n=t._transitionClasses||(t._transitionClasses=[]);n.indexOf(e)<0&&(n.push(e),ir(t,e))}function lr(t,e){t._transitionClasses&&h(t._transitionClasses,e),or(t,e)}function ur(t,e,n){var r=fr(t,e),i=r.type,o=r.timeout,a=r.propCount;if(!i)return n();var s=i===ys?ws:$s,c=0,l=function(){t.removeEventListener(s,u),n()},u=function(e){e.target===t&&++c>=a&&l()};setTimeout(function(){c0&&(n=ys,u=a,f=o.length):e===_s?l>0&&(n=_s,u=l,f=c.length):(u=Math.max(a,l),n=u>0?a>l?ys:_s:null,f=n?n===ys?o.length:c.length:0),{type:n,timeout:u,propCount:f,hasTransform:n===ys&&ks.test(r[bs+"Property"])}}function dr(t,e){for(;t.length1}function yr(t,e){!0!==e.data.show&&vr(e)}function _r(t,e,n){br(t,e,n),(wo||$o)&&setTimeout(function(){br(t,e,n)},0)}function br(t,e,n){var r=e.value,i=t.multiple;if(!i||Array.isArray(r)){for(var o,a,s=0,c=t.options.length;s-1,a.selected!==o&&(a.selected=o);else if($(xr(a),r))return void(t.selectedIndex!==s&&(t.selectedIndex=s));i||(t.selectedIndex=-1)}}function wr(t,e){return e.every(function(e){return!$(e,t)})}function xr(t){return"_value"in t?t._value:t.value}function $r(t){t.target.composing=!0}function Cr(t){t.target.composing&&(t.target.composing=!1,kr(t.target,"input"))}function kr(t,e){var n=document.createEvent("HTMLEvents");n.initEvent(e,!0,!0),t.dispatchEvent(n)}function Ar(t){return!t.componentInstance||t.data&&t.data.transition?t:Ar(t.componentInstance._vnode)}function Or(t){var e=t&&t.componentOptions;return e&&e.Ctor.options.abstract?Or(bt(e.children)):t}function Sr(t){var e={},n=t.$options;for(var r in n.propsData)e[r]=t[r];var i=n._parentListeners;for(var o in i)e[oo(o)]=i[o];return e}function Tr(t,e){if(/\d-keep-alive$/.test(e.tag))return t("keep-alive",{props:e.componentOptions.propsData})}function Er(t){for(;t=t.parent;)if(t.data.transition)return!0}function Ir(t,e){return e.key===t.key&&e.tag===t.tag}function Mr(t){t.elm._moveCb&&t.elm._moveCb(),t.elm._enterCb&&t.elm._enterCb()}function Lr(t){t.data.newPos=t.elm.getBoundingClientRect()}function Nr(t){var e=t.data.pos,n=t.data.newPos,r=e.left-n.left,i=e.top-n.top;if(r||i){t.data.moved=!0;var o=t.elm.style;o.transform=o.WebkitTransform="translate("+r+"px,"+i+"px)",o.transitionDuration="0s"}}function Dr(t,e){var n=e?Us(e):Fs;if(n.test(t)){for(var r,i,o=[],a=n.lastIndex=0;r=n.exec(t);){i=r.index,i>a&&o.push(JSON.stringify(t.slice(a,i)));var s=xn(r[1].trim());o.push("_s("+s+")"),a=i+r[0].length}return a=0&&a[i].lowerCasedTag!==s;i--);else i=0;if(i>=0){for(var c=a.length-1;c>=i;c--)e.end&&e.end(a[c].tag,n,r);a.length=i,o=i&&a[i-1].tag}else"br"===s?e.start&&e.start(t,[],!0,n,r):"p"===s&&(e.start&&e.start(t,[],!1,n,r),e.end&&e.end(t,n,r))}for(var i,o,a=[],s=e.expectHTML,c=e.isUnaryTag||lo,l=e.canBeLeftOpenTag||lo,u=0;t;){if(i=t,o&&hc(o)){var f=0,d=o.toLowerCase(),p=mc[d]||(mc[d]=new RegExp("([\\s\\S]*?)(]*>)","i")),v=t.replace(p,function(t,n,r){return f=r.length,hc(d)||"noscript"===d||(n=n.replace(//g,"$1").replace(//g,"$1")),wc(d,n)&&(n=n.slice(1)),e.chars&&e.chars(n),""});u+=t.length-v.length,t=v,r(d,u-f,u)}else{var h=t.indexOf("<");if(0===h){if(ec.test(t)){var m=t.indexOf("--\x3e");if(m>=0){e.shouldKeepComment&&e.comment(t.substring(4,m)),n(m+3);continue}}if(nc.test(t)){var g=t.indexOf("]>");if(g>=0){n(g+2);continue}}var y=t.match(tc);if(y){n(y[0].length);continue}var _=t.match(Qs);if(_){var b=u;n(_[0].length),r(_[1],b,u);continue}var w=function(){var e=t.match(Gs);if(e){var r={tagName:e[1],attrs:[],start:u};n(e[0].length);for(var i,o;!(i=t.match(Zs))&&(o=t.match(qs));)n(o[0].length),r.attrs.push(o);if(i)return r.unarySlash=i[1],n(i[0].length),r.end=u,r}}();if(w){!function(t){var n=t.tagName,i=t.unarySlash;s&&("p"===o&&Js(n)&&r(o),l(n)&&o===n&&r(n));for(var u=c(n)||!!i,f=t.attrs.length,d=new Array(f),p=0;p=0){for($=t.slice(h);!(Qs.test($)||Gs.test($)||ec.test($)||nc.test($)||(C=$.indexOf("<",1))<0);)h+=C,$=t.slice(h);x=t.substring(0,h),n(h)}h<0&&(x=t,t=""),e.chars&&x&&e.chars(x)}if(t===i){e.chars&&e.chars(t);break}}r()}function Hr(t,e,n){return{type:1,tag:t,attrsList:e,attrsMap:ai(e),parent:n,children:[]}}function zr(t,e){function n(t){t.pre&&(s=!1),lc(t.tag)&&(c=!1)}ic=e.warn||Cn,lc=e.isPreTag||lo,uc=e.mustUseProp||lo,fc=e.getTagNamespace||lo,ac=kn(e.modules,"transformNode"),sc=kn(e.modules,"preTransformNode"),cc=kn(e.modules,"postTransformNode"),oc=e.delimiters;var r,i,o=[],a=!1!==e.preserveWhitespace,s=!1,c=!1;return Ur(t,{warn:ic,expectHTML:e.expectHTML,isUnaryTag:e.isUnaryTag,canBeLeftOpenTag:e.canBeLeftOpenTag,shouldDecodeNewlines:e.shouldDecodeNewlines,shouldDecodeNewlinesForHref:e.shouldDecodeNewlinesForHref,shouldKeepComment:e.comments,start:function(t,a,l){var u=i&&i.ns||fc(t);wo&&"svg"===u&&(a=li(a));var f=Hr(t,a,i);u&&(f.ns=u),ci(f)&&!Io()&&(f.forbidden=!0);for(var d=0;d':'
',vc.innerHTML.indexOf(" ")>0}function Qi(t){if(t.outerHTML)return t.outerHTML;var e=document.createElement("div");return e.appendChild(t.cloneNode(!0)),e.innerHTML}var to=Object.prototype.toString,eo=v("slot,component",!0),no=v("key,ref,slot,slot-scope,is"),ro=Object.prototype.hasOwnProperty,io=/-(\w)/g,oo=g(function(t){return t.replace(io,function(t,e){return e?e.toUpperCase():""})}),ao=g(function(t){return t.charAt(0).toUpperCase()+t.slice(1)}),so=/\B([A-Z])/g,co=g(function(t){return t.replace(so,"-$1").toLowerCase()}),lo=function(t,e,n){return!1},uo=function(t){return t},fo="data-server-rendered",po=["component","directive","filter"],vo=["beforeCreate","created","beforeMount","mounted","beforeUpdate","updated","beforeDestroy","destroyed","activated","deactivated","errorCaptured"],ho={optionMergeStrategies:Object.create(null),silent:!1,productionTip:!1,devtools:!1,performance:!1,errorHandler:null,warnHandler:null,ignoredElements:[],keyCodes:Object.create(null),isReservedTag:lo,isReservedAttr:lo,isUnknownElement:lo,getTagNamespace:x,parsePlatformTagName:uo,mustUseProp:lo,_lifecycleHooks:vo},mo=Object.freeze({}),go=/[^\w.$]/,yo="__proto__"in{},_o="undefined"!=typeof window,bo=_o&&window.navigator.userAgent.toLowerCase(),wo=bo&&/msie|trident/.test(bo),xo=bo&&bo.indexOf("msie 9.0")>0,$o=bo&&bo.indexOf("edge/")>0,Co=bo&&bo.indexOf("android")>0,ko=bo&&/iphone|ipad|ipod|ios/.test(bo),Ao=(bo&&/chrome\/\d+/.test(bo),{}.watch),Oo=!1;if(_o)try{var So={};Object.defineProperty(So,"passive",{get:function(){Oo=!0}}),window.addEventListener("test-passive",null,So)}catch(t){}var To,Eo,Io=function(){return void 0===To&&(To=!_o&&void 0!==t&&"server"===t.process.env.VUE_ENV),To},Mo=_o&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__,Lo="undefined"!=typeof Symbol&&T(Symbol)&&"undefined"!=typeof Reflect&&T(Reflect.ownKeys);Eo="undefined"!=typeof Set&&T(Set)?Set:function(){function t(){this.set=Object.create(null)}return t.prototype.has=function(t){return!0===this.set[t]},t.prototype.add=function(t){this.set[t]=!0},t.prototype.clear=function(){this.set=Object.create(null)},t}();var No=x,Do=0,jo=function(){this.id=Do++,this.subs=[]};jo.prototype.addSub=function(t){this.subs.push(t)},jo.prototype.removeSub=function(t){h(this.subs,t)},jo.prototype.depend=function(){jo.target&&jo.target.addDep(this)},jo.prototype.notify=function(){for(var t=this.subs.slice(),e=0,n=t.length;e1?_(n):n;for(var r=_(arguments,1),i=0,o=n.length;iparseInt(this.max)&&Be(i,o[0],o,this._vnode)),t.data.keepAlive=!0}return t}},$a={KeepAlive:xa};!function(t){var e={};e.get=function(){return ho},Object.defineProperty(t,"config",e),t.util={warn:No,extend:b,mergeOptions:X,defineReactive:P},t.set=F,t.delete=B,t.nextTick=at,t.options=Object.create(null),po.forEach(function(e){t.options[e+"s"]=Object.create(null)}),t.options._base=t,b(t.options.components,$a),Ie(t),Me(t),Le(t),je(t)}(Ee),Object.defineProperty(Ee.prototype,"$isServer",{get:Io}),Object.defineProperty(Ee.prototype,"$ssrContext",{get:function(){return this.$vnode&&this.$vnode.ssrContext}}),Ee.version="2.5.3";var Ca,ka,Aa,Oa,Sa,Ta,Ea,Ia,Ma,La=v("style,class"),Na=v("input,textarea,option,select,progress"),Da=function(t,e,n){return"value"===n&&Na(t)&&"button"!==e||"selected"===n&&"option"===t||"checked"===n&&"input"===t||"muted"===n&&"video"===t},ja=v("contenteditable,draggable,spellcheck"),Ra=v("allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,default,defaultchecked,defaultmuted,defaultselected,defer,disabled,enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,required,reversed,scoped,seamless,selected,sortable,translate,truespeed,typemustmatch,visible"),Pa="http://www.w3.org/1999/xlink",Fa=function(t){return":"===t.charAt(5)&&"xlink"===t.slice(0,5)},Ba=function(t){return Fa(t)?t.slice(6,t.length):""},Ua=function(t){return null==t||!1===t},Ha={svg:"http://www.w3.org/2000/svg",math:"http://www.w3.org/1998/Math/MathML"},za=v("html,body,base,head,link,meta,style,title,address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,menuitem,summary,content,element,shadow,template,blockquote,iframe,tfoot"),Va=v("svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,font-face,foreignObject,g,glyph,image,line,marker,mask,missing-glyph,path,pattern,polygon,polyline,rect,switch,symbol,text,textpath,tspan,use,view",!0),Wa=function(t){return"pre"===t},Ka=function(t){return za(t)||Va(t)},Ja=Object.create(null),qa=v("text,number,password,search,email,tel,url"),Xa=Object.freeze({createElement:Ge,createElementNS:Ze,createTextNode:Qe,createComment:tn,insertBefore:en,removeChild:nn,appendChild:rn,parentNode:on,nextSibling:an,tagName:sn,setTextContent:cn,setAttribute:ln}),Ya={create:function(t,e){un(e)},update:function(t,e){t.data.ref!==e.data.ref&&(un(t,!0),un(e))},destroy:function(t){un(t,!0)}},Ga=new Po("",{},[]),Za=["create","activate","update","remove","destroy"],Qa={create:vn,update:vn,destroy:function(t){vn(t,Ga)}},ts=Object.create(null),es=[Ya,Qa],ns={create:_n,update:_n},rs={create:wn,update:wn},is=/[\w).+\-_$\]]/,os="__r",as="__c",ss={create:Xn,update:Xn},cs={create:Yn,update:Yn},ls=g(function(t){var e={},n=/;(?![^(]*\))/g,r=/:(.+)/;return t.split(n).forEach(function(t){if(t){var n=t.split(r);n.length>1&&(e[n[0].trim()]=n[1].trim())}}),e}),us=/^--/,fs=/\s*!important$/,ds=function(t,e,n){if(us.test(e))t.style.setProperty(e,n);else if(fs.test(n))t.style.setProperty(e,n.replace(fs,""),"important");else{var r=vs(e);if(Array.isArray(n))for(var i=0,o=n.length;iv?(f=r(n[g+1])?null:n[g+1].elm,y(t,f,n,p,g,o)):p>g&&b(t,e,d,v)}function $(t,e,n,r){for(var o=n;o\/=]+)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/,Xs="[a-zA-Z_][\\w\\-\\.]*",Ys="((?:"+Xs+"\\:)?"+Xs+")",Gs=new RegExp("^<"+Ys),Zs=/^\s*(\/?)>/,Qs=new RegExp("^<\\/"+Ys+"[^>]*>"),tc=/^]+>/i,ec=/^ 21 | 22 |
23 | 24 |
{{options}}
25 | 26 | 27 | 28 | 29 | 68 | 69 | -------------------------------------------------------------------------------- /src/slider.vue: -------------------------------------------------------------------------------- 1 | 19 | 20 | 498 | 499 | 500 | -------------------------------------------------------------------------------- /webpack.config.js: -------------------------------------------------------------------------------- 1 | var path = require('path') 2 | var webpack = require('webpack') 3 | 4 | module.exports = { 5 | entry: './src/main.js', 6 | output: { 7 | path: path.resolve(__dirname, './dist'), 8 | publicPath: '/dist/', 9 | filename: 'build.js' 10 | }, 11 | module: { 12 | rules: [ 13 | { 14 | test: /\.vue$/, 15 | loader: 'vue-loader', 16 | options: { 17 | loaders: { 18 | // Since sass-loader (weirdly) has SCSS as its default parse mode, we map 19 | // the "scss" and "sass" values for the lang attribute to the right configs here. 20 | // other preprocessors should work out of the box, no loader config like this necessary. 21 | 'scss': 'vue-style-loader!css-loader!sass-loader', 22 | 'sass': 'vue-style-loader!css-loader!sass-loader?indentedSyntax' 23 | } 24 | // other vue-loader options go here 25 | } 26 | }, 27 | { 28 | test: /\.js$/, 29 | loader: 'babel-loader', 30 | exclude: /node_modules/ 31 | }, 32 | { 33 | test: /\.(png|jpg|gif|svg)$/, 34 | loader: 'file-loader', 35 | options: { 36 | name: '[name].[ext]?[hash]' 37 | } 38 | } 39 | ] 40 | }, 41 | resolve: { 42 | alias: { 43 | 'vue$': 'vue/dist/vue.esm.js' 44 | } 45 | }, 46 | devServer: { 47 | historyApiFallback: true, 48 | noInfo: true 49 | }, 50 | performance: { 51 | hints: false 52 | }, 53 | devtool: '#eval-source-map' 54 | } 55 | 56 | if (process.env.NODE_ENV === 'production') { 57 | module.exports.devtool = '#source-map' 58 | // http://vue-loader.vuejs.org/en/workflow/production.html 59 | module.exports.plugins = (module.exports.plugins || []).concat([ 60 | new webpack.DefinePlugin({ 61 | 'process.env': { 62 | NODE_ENV: '"production"' 63 | } 64 | }), 65 | new webpack.optimize.UglifyJsPlugin({ 66 | sourceMap: true, 67 | compress: { 68 | warnings: false 69 | } 70 | }), 71 | new webpack.LoaderOptionsPlugin({ 72 | minimize: true 73 | }) 74 | ]) 75 | } 76 | --------------------------------------------------------------------------------