-
Notifications
You must be signed in to change notification settings - Fork 26
/
index.js
1 lines (1 loc) · 3.82 KB
/
index.js
1
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("vue")):"function"==typeof define&&define.amd?define(["vue"],e):"object"==typeof exports?exports.VueIscrollView=e(require("vue")):t.VueIscrollView=e(t.vue)}(this,function(t){return function(t){function e(o){if(r[o])return r[o].exports;var n=r[o]={i:o,l:!1,exports:{}};return t[o].call(n.exports,n,n.exports,e),n.l=!0,n.exports}var r={};return e.m=t,e.c=r,e.i=function(t){return t},e.d=function(t,r,o){e.o(t,r)||Object.defineProperty(t,r,{configurable:!1,enumerable:!0,get:o})},e.n=function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(r,"a",r),r},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=4)}([function(t,e,r){var o,n;o=r(1);var l=r(2);n=o=o||{},"object"!=typeof o.default&&"function"!=typeof o.default||(n=o=o.default),"function"==typeof n&&(n=n.options),n.render=l.render,n.staticRenderFns=l.staticRenderFns,t.exports=o},function(t,e,r){"use strict";function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=r(3),l=o(n);e.default={name:"iscroll-view",props:{options:{type:Object,default:function(){return{}}},wrapperClass:{type:Object,default:function(){return{}}},wrapperStyle:{type:Object,default:function(){return{}}},scrollerClass:{type:Object,default:function(){return{}}},scrollerStyle:{type:Object,default:function(){return{}}}},methods:{_registPullEvents:function(){var t=this,e=this.iscroll;e.on("scrollEnd",function(r){e.y<=e.maxScrollY?t.$emit("pullUp",e):e.y>=0&&t.$emit("pullDown",e)})},zoom:function(){var t=this,e=arguments;this.$nextTick(function(){return t.iscroll.zoom.apply(t.iscroll,e)})},goToPage:function(){var t=this,e=arguments;this.$nextTick(function(){return t.iscroll.goToPage.apply(t.iscroll,e)})},next:function(){var t=this,e=arguments;this.$nextTick(function(){return t.iscroll.next.apply(t.iscroll,e)})},prev:function(){var t=this,e=arguments;this.$nextTick(function(){return t.iscroll.prev.apply(t.iscroll,e)})},scrollToElement:function(){var t=this,e=arguments;this.$nextTick(function(){return t.iscroll.scrollToElement.apply(t.iscroll,e)})},scrollBy:function(){var t=this,e=arguments;this.$nextTick(function(){return t.iscroll.scrollBy.apply(t.iscroll,e)})},scrollTo:function(){var t=this,e=arguments;this.$nextTick(function(){return t.iscroll.scrollTo.apply(t.iscroll,e)})},refresh:function(){var t=this,e=arguments;this.$nextTick(function(){return t.iscroll.refresh.apply(t.iscroll,e)})}},beforeDestroy:function(){this.iscroll&&this.iscroll.destroy(),this.iscroll=null},mounted:function(){var t=this,e=["beforeScrollStart","scrollCancel","scrollStart","scrollEnd","scroll","flick","zoomStart","zoomEnd"];setTimeout(function(){var e=void 0,r=void 0,o=t.$refs.scrollView.attributes;t.$refs.scrollView.scrollTop=0;for(e in o)r=o[e],r instanceof Attr&&r.name.indexOf("data-v-")>-1&&t.$refs.scroller.attributes.setNamedItem(document.createAttribute(r.name));try{location.hash&&t.iscroll.scrollToElement(location.hash,0)}catch(t){}},0),this.$nextTick(function(){var r=l.default._IScroll;t.iscroll=new r(t.$refs.scrollView,t.options),e.forEach(function(e){t.iscroll.on(e,function(){return t.$emit(e,t.iscroll)})}),t._registPullEvents()})}}},function(t,e){t.exports={render:function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{ref:"scrollView",class:t.wrapperClass,style:t.wrapperStyle},[r("div",{ref:"scroller",class:t.scrollerClass,style:t.scrollerStyle},[t._t("default")],2)])},staticRenderFns:[]}},function(e,r){e.exports=t},function(t,e,r){"use strict";function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var n=r(0),l=o(n);e.default={install:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t._IScroll=e.IScroll||e,t.component("iscroll-view",l.default)}}}])});