UNPKG

@xysfe/actui

Version:

A fantastic mobile ui lib implement by Vue

1 lines 5.39 kB
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("@xysfe/actui/es/BScroll/index.js"),require("@xysfe/actui/es/assets/utils/BScroll/constants.js")):"function"==typeof define&&define.amd?define(["@xysfe/actui/es/BScroll/index.js","@xysfe/actui/es/assets/utils/BScroll/constants.js"],e):"object"==typeof exports?exports.Scroll=e(require("@xysfe/actui/es/BScroll/index.js"),require("@xysfe/actui/es/assets/utils/BScroll/constants.js")):t.Scroll=e(t["@xysfe/actui/es/BScroll/index.js"],t["@xysfe/actui/es/assets/utils/BScroll/constants.js"])}("undefined"!=typeof self?self:this,function(t,e){return function(t){function e(l){if(o[l])return o[l].exports;var s=o[l]={i:l,l:!1,exports:{}};return t[l].call(s.exports,s,s.exports,e),s.l=!0,s.exports}var o={};return e.m=t,e.c=o,e.d=function(t,o,l){e.o(t,o)||Object.defineProperty(t,o,{configurable:!1,enumerable:!0,get:l})},e.n=function(t){var o=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(o,"a",o),o},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="../es",e(e.s=2032)}({1224:function(t,e,o){"use strict";var l=o(196),s=o.n(l),n=o(782);o.n(n);e.a={name:"ActScroll",props:{probeType:{type:Number,default:2},click:{type:Boolean,default:!0},listenScrollInit:{type:Boolean,default:!1},listenScroll:{type:Boolean,default:!1},listenBeforeScroll:{type:Boolean,default:!1},listenScrollEnd:{type:Boolean,default:!1},listenZoomEnd:{type:Boolean,default:!1},listenPullingUp:{type:Boolean,default:!1},direction:{type:String,default:"vertical"},scrollbar:{type:null,default:!1},startY:{type:Number,default:0},refreshDelay:{type:Number,default:20},freeScroll:{type:Boolean,default:!1},mouseWheel:{type:Boolean,default:!1},bounce:{type:[Boolean,Object],default:!0},zoom:{type:Boolean,default:!1},useTransition:{type:Boolean,default:!0}},data:function(){return{beforePullDown:!0,isRebounding:!1,pullUpDirty:!0,pullDownStyle:"",bubbleY:0,lastTouchStart:null,fingers:0,tapTarget:null,isDouble:!1,startXd:0,startYd:0,endXd:0,endYd:0}},mounted:function(){var t=this;this.$nextTick(function(){t.initScroll()})},destroyed:function(){this.scroll&&this.scroll.destroy(),this.$emit("destroyed",this.scroll)},methods:{initScroll:function(){var t=this;if(this.$refs.wrapper){var e={probeType:this.probeType,click:this.click,scrollY:this.freeScroll||"vertical"===this.direction,scrollX:this.freeScroll||"horizontal"===this.direction,scrollbar:this.scrollbar,startY:this.startY,freeScroll:this.freeScroll,mouseWheel:this.mouseWheel,bounce:this.bounce,zoom:this.zoom,bounceTime:300,useTransition:n.USE_TRANSITION&&this.useTransition,pullUpLoad:{threshold:50}};this.scroll=new s.a(this.$refs.wrapper,e),this.listenScroll&&this.scroll.on("scroll",function(e){t.$emit("scroll",e)}),this.listenScrollEnd&&this.scroll.on("scrollEnd",function(e){t.$emit("scroll-end",e)}),this.listenBeforeScroll&&(this.scroll.on("beforeScrollStart",function(){t.$emit("beforeScrollStart")}),this.scroll.on("scrollStart",function(){t.$emit("scroll-start")})),this.listenZoomEnd&&this.scroll.on("zoomEnd",function(){t.$emit("zoomEnd",t.scroll)}),this.zoom&&(this.isDouble=!0),this.listenScrollInit&&this.$emit("scrollSuc",this.scroll),this.listenPullingUp&&this.scroll.on("pullingUp",function(){t.$emit("pullingUp")})}},disable:function(){this.scroll&&this.scroll.disable()},enable:function(){this.scroll&&this.scroll.enable()},refresh:function(){this.scroll&&this.scroll.refresh()},scrollTo:function(){this.scroll&&this.scroll.scrollTo.apply(this.scroll,arguments)},scrollToElement:function(){this.scroll&&this.scroll.scrollToElement.apply(this.scroll,arguments)},clickItem:function(t,e){this.$emit("click",e)},destroy:function(){this.scroll.destroy()},forceUpdate:function(t){this.refresh()}}}},196:function(e,o){e.exports=t},2032:function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var l=o(2033);l.a.install=function(t){t.component(l.a.name,l.a)},e.default=l.a},2033:function(t,e,o){"use strict";function l(t){i||o(2034)}var s=o(1224),n=o(2035),r=o(7),i=!1,c=l,u=Object(r.a)(s.a,n.a,n.b,!1,c,"data-v-3349a91e",null);u.options.__file="src\\components\\common\\scroll.vue",e.a=u.exports},2034:function(t,e){},2035:function(t,e,o){"use strict";o.d(e,"a",function(){return l}),o.d(e,"b",function(){return s});var l=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",{ref:"wrapper",staticClass:"scroll-wrapper"},[o("div",{staticClass:"scroll-content"},[t._t("default")],2)])},s=[];l._withStripped=!0},7:function(t,e,o){"use strict";function l(t,e,o,l,s,n,r,i){t=t||{};var c=typeof t.default;"object"!==c&&"function"!==c||(t=t.default);var u="function"==typeof t?t.options:t;e&&(u.render=e,u.staticRenderFns=o,u._compiled=!0),l&&(u.functional=!0),n&&(u._scopeId=n);var a;if(r?(a=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__),s&&s.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(r)},u._ssrRegister=a):s&&(a=i?function(){s.call(this,this.$root.$options.shadowRoot)}:s),a)if(u.functional){u._injectStyles=a;var f=u.render;u.render=function(t,e){return a.call(e),f(t,e)}}else{var d=u.beforeCreate;u.beforeCreate=d?[].concat(d,a):[a]}return{exports:t,options:u}}e.a=l},782:function(t,o){t.exports=e}})});