37.b26eb85d.js 3.4 KB

1
  1. (window.webpackJsonp=window.webpackJsonp||[]).push([[37],{444:function(t,s,o){"use strict";var l=o(435),i=[{key:"finishPullUp",name:"finishPullUp"},{key:"openPullUp",name:"openPullUp"},{key:"closePullUp",name:"closePullUp"},{key:"autoPullUpLoad",name:"autoPullUpLoad"}].map((function(t){return{key:t.key,sourceKey:"plugins.pullUpLoad."+t.name}})),e=function(){function t(t){this.scroll=t,this.pulling=!1,this.watching=!1,this.init()}return t.prototype.init=function(){this.handleBScroll(),this.handleOptions(this.scroll.options.pullUpLoad),this.handleHooks(),this.watch()},t.prototype.handleBScroll=function(){this.scroll.registerType(["pullingUp"]),this.scroll.proxy(i)},t.prototype.handleOptions=function(t){void 0===t&&(t={}),t=!0===t?{}:t;this.options=Object(l.t)({threshold:0},t),this.scroll.options.probeType=l.j.Realtime},t.prototype.handleHooks=function(){var t=this;this.hooksFn=[];var s=this.scroll.scroller.scrollBehaviorY;this.registerHooks(this.scroll.hooks,this.scroll.hooks.eventTypes.contentChanged,(function(){t.finishPullUp()})),this.registerHooks(s.hooks,s.hooks.eventTypes.computeBoundary,(function(t){t.maxScrollPos>0&&(t.maxScrollPos=-1)}))},t.prototype.registerHooks=function(t,s,o){t.on(s,o,this),this.hooksFn.push([t,s,o])},t.prototype.watch=function(){this.watching||(this.watching=!0,this.registerHooks(this.scroll,this.scroll.eventTypes.scroll,this.checkPullUp))},t.prototype.unwatch=function(){this.watching=!1,this.scroll.off(this.scroll.eventTypes.scroll,this.checkPullUp)},t.prototype.checkPullUp=function(t){var s=this,o=this.options.threshold;this.scroll.movingDirectionY===l.b.Positive&&t.y<=this.scroll.maxScrollY+o&&(this.pulling=!0,this.scroll.once(this.scroll.eventTypes.scrollEnd,(function(){s.pulling=!1})),this.unwatch(),this.scroll.trigger("pullingUp"))},t.prototype.finishPullUp=function(){var t=this;this.scroll.scroller.scrollBehaviorY.setMovingDirection(l.b.Default),this.pulling?this.scroll.once(this.scroll.eventTypes.scrollEnd,(function(){t.watch()})):this.watch()},t.prototype.openPullUp=function(t){void 0===t&&(t={}),this.handleOptions(t),this.watch()},t.prototype.closePullUp=function(){this.unwatch()},t.prototype.autoPullUpLoad=function(){var t=this.options.threshold,s=this.scroll.scroller.scrollBehaviorY;if(!this.pulling&&this.watching){var o=s.maxScrollPos+t+-1;this.scroll.scroller.scrollBehaviorY.setMovingDirection(-1),this.scroll.scrollTo(this.scroll.x,o,this.scroll.options.bounceTime)}},t.pluginName="pullUpLoad",t}();s.a=e},519:function(t,s,o){},592:function(t,s,o){"use strict";o(519)},744:function(t,s,o){"use strict";o.r(s);var l=o(436),i=o(444);l.a.use(i.a);var e={data:function(){return{isPullUpLoad:!1,data1:10,data2:10}},mounted:function(){this.initBscroll()},methods:{initBscroll:function(){this.bscroll=new l.a(this.$refs.scroller,{autoBlur:!0})}}},n=(o(592),o(41)),r=Object(n.a)(e,(function(){var t=this._self._c;return t("div",{staticClass:"textarea-container"},[t("div",{ref:"scroller",staticClass:"textarea-wrapper"},[t("div",{staticClass:"textarea-scroller"},[t("ul",{staticClass:"textarea-list"},[this._l(this.data1,(function(s){return t("li",{key:s,staticClass:"textarea-list-item"})})),this._v(" "),t("textarea",{staticClass:"textarea-text",attrs:{name:"",id:"",cols:"30",rows:"10"}},[this._v("Manipulating this area can not make BetterScroll work.")]),this._v(" "),this._l(this.data2,(function(s){return t("li",{key:s+10,staticClass:"textarea-list-item"})}))],2)])])])}),[],!1,null,"3de3ac9c",null);s.default=r.exports}}]);