index.js 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783
  1. module.exports =
  2. /******/ (function(modules) { // webpackBootstrap
  3. /******/ // The module cache
  4. /******/ var installedModules = {};
  5. /******/ // The require function
  6. /******/ function __webpack_require__(moduleId) {
  7. /******/ // Check if module is in cache
  8. /******/ if(installedModules[moduleId])
  9. /******/ return installedModules[moduleId].exports;
  10. /******/ // Create a new module (and put it into the cache)
  11. /******/ var module = installedModules[moduleId] = {
  12. /******/ i: moduleId,
  13. /******/ l: false,
  14. /******/ exports: {}
  15. /******/ };
  16. /******/ // Execute the module function
  17. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  18. /******/ // Flag the module as loaded
  19. /******/ module.l = true;
  20. /******/ // Return the exports of the module
  21. /******/ return module.exports;
  22. /******/ }
  23. /******/ // expose the modules object (__webpack_modules__)
  24. /******/ __webpack_require__.m = modules;
  25. /******/ // expose the module cache
  26. /******/ __webpack_require__.c = installedModules;
  27. /******/ // identity function for calling harmony imports with the correct context
  28. /******/ __webpack_require__.i = function(value) { return value; };
  29. /******/ // define getter function for harmony exports
  30. /******/ __webpack_require__.d = function(exports, name, getter) {
  31. /******/ if(!__webpack_require__.o(exports, name)) {
  32. /******/ Object.defineProperty(exports, name, {
  33. /******/ configurable: false,
  34. /******/ enumerable: true,
  35. /******/ get: getter
  36. /******/ });
  37. /******/ }
  38. /******/ };
  39. /******/ // getDefaultExport function for compatibility with non-harmony modules
  40. /******/ __webpack_require__.n = function(module) {
  41. /******/ var getter = module && module.__esModule ?
  42. /******/ function getDefault() { return module['default']; } :
  43. /******/ function getModuleExports() { return module; };
  44. /******/ __webpack_require__.d(getter, 'a', getter);
  45. /******/ return getter;
  46. /******/ };
  47. /******/ // Object.prototype.hasOwnProperty.call
  48. /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
  49. /******/ // __webpack_public_path__
  50. /******/ __webpack_require__.p = "";
  51. /******/ // Load entry module and return exports
  52. /******/ return __webpack_require__(__webpack_require__.s = 224);
  53. /******/ })
  54. /************************************************************************/
  55. /******/ ({
  56. /***/ 0:
  57. /***/ function(module, exports) {
  58. /* globals __VUE_SSR_CONTEXT__ */
  59. // this module is a runtime utility for cleaner component module output and will
  60. // be included in the final webpack user bundle
  61. module.exports = function normalizeComponent (
  62. rawScriptExports,
  63. compiledTemplate,
  64. injectStyles,
  65. scopeId,
  66. moduleIdentifier /* server only */
  67. ) {
  68. var esModule
  69. var scriptExports = rawScriptExports = rawScriptExports || {}
  70. // ES6 modules interop
  71. var type = typeof rawScriptExports.default
  72. if (type === 'object' || type === 'function') {
  73. esModule = rawScriptExports
  74. scriptExports = rawScriptExports.default
  75. }
  76. // Vue.extend constructor export interop
  77. var options = typeof scriptExports === 'function'
  78. ? scriptExports.options
  79. : scriptExports
  80. // render functions
  81. if (compiledTemplate) {
  82. options.render = compiledTemplate.render
  83. options.staticRenderFns = compiledTemplate.staticRenderFns
  84. }
  85. // scopedId
  86. if (scopeId) {
  87. options._scopeId = scopeId
  88. }
  89. var hook
  90. if (moduleIdentifier) { // server build
  91. hook = function (context) {
  92. // 2.3 injection
  93. context =
  94. context || // cached call
  95. (this.$vnode && this.$vnode.ssrContext) || // stateful
  96. (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
  97. // 2.2 with runInNewContext: true
  98. if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
  99. context = __VUE_SSR_CONTEXT__
  100. }
  101. // inject component styles
  102. if (injectStyles) {
  103. injectStyles.call(this, context)
  104. }
  105. // register component module identifier for async chunk inferrence
  106. if (context && context._registeredComponents) {
  107. context._registeredComponents.add(moduleIdentifier)
  108. }
  109. }
  110. // used by ssr in case component is cached and beforeCreate
  111. // never gets called
  112. options._ssrRegister = hook
  113. } else if (injectStyles) {
  114. hook = injectStyles
  115. }
  116. if (hook) {
  117. var functional = options.functional
  118. var existing = functional
  119. ? options.render
  120. : options.beforeCreate
  121. if (!functional) {
  122. // inject component registration as beforeCreate hook
  123. options.beforeCreate = existing
  124. ? [].concat(existing, hook)
  125. : [hook]
  126. } else {
  127. // register for functioal component in vue file
  128. options.render = function renderWithStyleInjection (h, context) {
  129. hook.call(context)
  130. return existing(h, context)
  131. }
  132. }
  133. }
  134. return {
  135. esModule: esModule,
  136. exports: scriptExports,
  137. options: options
  138. }
  139. }
  140. /***/ },
  141. /***/ 10:
  142. /***/ function(module, exports, __webpack_require__) {
  143. "use strict";
  144. Object.defineProperty(exports, "__esModule", { value: true });
  145. /* harmony default export */ exports["default"] = {
  146. computed: {
  147. spinnerColor: function spinnerColor() {
  148. return this.color || this.$parent.color || '#ccc';
  149. },
  150. spinnerSize: function spinnerSize() {
  151. return (this.size || this.$parent.size || 28) + 'px';
  152. }
  153. },
  154. props: {
  155. size: Number,
  156. color: String
  157. }
  158. };
  159. /***/ },
  160. /***/ 11:
  161. /***/ function(module, exports, __webpack_require__) {
  162. "use strict";
  163. Object.defineProperty(exports, "__esModule", { value: true });
  164. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__common_vue__ = __webpack_require__(6);
  165. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__common_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__common_vue__);
  166. //
  167. //
  168. //
  169. //
  170. //
  171. //
  172. //
  173. //
  174. //
  175. /* harmony default export */ exports["default"] = {
  176. name: 'fading-circle',
  177. mixins: [__WEBPACK_IMPORTED_MODULE_0__common_vue___default.a],
  178. created: function created() {
  179. if (this.$isServer) return;
  180. this.styleNode = document.createElement('style');
  181. var css = ".circle-color-" + (this._uid) + " > div::before { background-color: " + (this.spinnerColor) + "; }";
  182. this.styleNode.type = 'text/css';
  183. this.styleNode.rel = 'stylesheet';
  184. this.styleNode.title = 'fading circle style';
  185. document.getElementsByTagName('head')[0].appendChild(this.styleNode);
  186. this.styleNode.appendChild(document.createTextNode(css));
  187. },
  188. destroyed: function destroyed() {
  189. if (this.styleNode) {
  190. this.styleNode.parentNode.removeChild(this.styleNode);
  191. }
  192. }
  193. };
  194. /***/ },
  195. /***/ 124:
  196. /***/ function(module, exports) {
  197. // removed by extract-text-webpack-plugin
  198. /***/ },
  199. /***/ 14:
  200. /***/ function(module, exports) {
  201. // removed by extract-text-webpack-plugin
  202. /***/ },
  203. /***/ 142:
  204. /***/ function(module, exports, __webpack_require__) {
  205. function injectStyle (ssrContext) {
  206. __webpack_require__(124)
  207. }
  208. var Component = __webpack_require__(0)(
  209. /* script */
  210. __webpack_require__(64),
  211. /* template */
  212. __webpack_require__(194),
  213. /* styles */
  214. injectStyle,
  215. /* scopeId */
  216. null,
  217. /* moduleIdentifier (server only) */
  218. null
  219. )
  220. module.exports = Component.exports
  221. /***/ },
  222. /***/ 15:
  223. /***/ function(module, exports, __webpack_require__) {
  224. function injectStyle (ssrContext) {
  225. __webpack_require__(14)
  226. }
  227. var Component = __webpack_require__(0)(
  228. /* script */
  229. __webpack_require__(11),
  230. /* template */
  231. __webpack_require__(16),
  232. /* styles */
  233. injectStyle,
  234. /* scopeId */
  235. null,
  236. /* moduleIdentifier (server only) */
  237. null
  238. )
  239. module.exports = Component.exports
  240. /***/ },
  241. /***/ 16:
  242. /***/ function(module, exports) {
  243. module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
  244. return _c('div', {
  245. class: ['mint-spinner-fading-circle circle-color-' + _vm._uid],
  246. style: ({
  247. width: _vm.spinnerSize,
  248. height: _vm.spinnerSize
  249. })
  250. }, _vm._l((12), function(n) {
  251. return _c('div', {
  252. staticClass: "mint-spinner-fading-circle-circle",
  253. class: ['is-circle' + (n + 1)]
  254. })
  255. }))
  256. },staticRenderFns: []}
  257. /***/ },
  258. /***/ 194:
  259. /***/ function(module, exports) {
  260. module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
  261. return _c('div', {
  262. staticClass: "mint-loadmore"
  263. }, [_c('div', {
  264. staticClass: "mint-loadmore-content",
  265. class: {
  266. 'is-dropped': _vm.topDropped || _vm.bottomDropped
  267. },
  268. style: ({
  269. 'transform': _vm.transform
  270. })
  271. }, [_vm._t("top", [(_vm.topMethod) ? _c('div', {
  272. staticClass: "mint-loadmore-top"
  273. }, [(_vm.topStatus === 'loading') ? _c('spinner', {
  274. staticClass: "mint-loadmore-spinner",
  275. attrs: {
  276. "size": 20,
  277. "type": "fading-circle"
  278. }
  279. }) : _vm._e(), _vm._v(" "), _c('span', {
  280. staticClass: "mint-loadmore-text"
  281. }, [_vm._v(_vm._s(_vm.topText))])], 1) : _vm._e()]), _vm._v(" "), _vm._t("default"), _vm._v(" "), _vm._t("bottom", [(_vm.bottomMethod) ? _c('div', {
  282. staticClass: "mint-loadmore-bottom"
  283. }, [(_vm.bottomStatus === 'loading') ? _c('spinner', {
  284. staticClass: "mint-loadmore-spinner",
  285. attrs: {
  286. "size": 20,
  287. "type": "fading-circle"
  288. }
  289. }) : _vm._e(), _vm._v(" "), _c('span', {
  290. staticClass: "mint-loadmore-text"
  291. }, [_vm._v(_vm._s(_vm.bottomText))])], 1) : _vm._e()])], 2)])
  292. },staticRenderFns: []}
  293. /***/ },
  294. /***/ 224:
  295. /***/ function(module, exports, __webpack_require__) {
  296. module.exports = __webpack_require__(32);
  297. /***/ },
  298. /***/ 32:
  299. /***/ function(module, exports, __webpack_require__) {
  300. "use strict";
  301. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__src_loadmore_vue__ = __webpack_require__(142);
  302. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__src_loadmore_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__src_loadmore_vue__);
  303. Object.defineProperty(exports, "__esModule", { value: true });
  304. /* harmony reexport (default from non-hamory) */ __webpack_require__.d(exports, "default", function() { return __WEBPACK_IMPORTED_MODULE_0__src_loadmore_vue___default.a; });
  305. /***/ },
  306. /***/ 6:
  307. /***/ function(module, exports, __webpack_require__) {
  308. var Component = __webpack_require__(0)(
  309. /* script */
  310. __webpack_require__(10),
  311. /* template */
  312. null,
  313. /* styles */
  314. null,
  315. /* scopeId */
  316. null,
  317. /* moduleIdentifier (server only) */
  318. null
  319. )
  320. module.exports = Component.exports
  321. /***/ },
  322. /***/ 64:
  323. /***/ function(module, exports, __webpack_require__) {
  324. "use strict";
  325. Object.defineProperty(exports, "__esModule", { value: true });
  326. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_mint_ui_packages_spinner_src_spinner_fading_circle_vue__ = __webpack_require__(15);
  327. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_mint_ui_packages_spinner_src_spinner_fading_circle_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_mint_ui_packages_spinner_src_spinner_fading_circle_vue__);
  328. //
  329. //
  330. //
  331. //
  332. //
  333. //
  334. //
  335. //
  336. //
  337. //
  338. //
  339. //
  340. //
  341. //
  342. //
  343. //
  344. //
  345. //
  346. //
  347. //
  348. //
  349. //
  350. //
  351. //
  352. //
  353. //
  354. //
  355. //
  356. //
  357. //
  358. //
  359. //
  360. //
  361. //
  362. //
  363. //
  364. //
  365. //
  366. //
  367. //
  368. //
  369. //
  370. //
  371. //
  372. //
  373. //
  374. //
  375. //
  376. //
  377. //
  378. //
  379. //
  380. //
  381. //
  382. //
  383. //
  384. //
  385. //
  386. /* harmony default export */ exports["default"] = {
  387. name: 'mt-loadmore',
  388. components: {
  389. 'spinner': __WEBPACK_IMPORTED_MODULE_0_mint_ui_packages_spinner_src_spinner_fading_circle_vue___default.a
  390. },
  391. props: {
  392. maxDistance: {
  393. type: Number,
  394. default: 0
  395. },
  396. autoFill: {
  397. type: Boolean,
  398. default: true
  399. },
  400. distanceIndex: {
  401. type: Number,
  402. default: 2
  403. },
  404. topPullText: {
  405. type: String,
  406. default: '下拉刷新'
  407. },
  408. topDropText: {
  409. type: String,
  410. default: '释放更新'
  411. },
  412. topLoadingText: {
  413. type: String,
  414. default: '加载中...'
  415. },
  416. topDistance: {
  417. type: Number,
  418. default: 70
  419. },
  420. topMethod: {
  421. type: Function
  422. },
  423. bottomPullText: {
  424. type: String,
  425. default: '上拉刷新'
  426. },
  427. bottomDropText: {
  428. type: String,
  429. default: '释放更新'
  430. },
  431. bottomLoadingText: {
  432. type: String,
  433. default: '加载中...'
  434. },
  435. bottomDistance: {
  436. type: Number,
  437. default: 70
  438. },
  439. bottomMethod: {
  440. type: Function
  441. },
  442. bottomAllLoaded: {
  443. type: Boolean,
  444. default: false
  445. }
  446. },
  447. data: function data() {
  448. return {
  449. translate: 0,
  450. scrollEventTarget: null,
  451. containerFilled: false,
  452. topText: '',
  453. topDropped: false,
  454. bottomText: '',
  455. bottomDropped: false,
  456. bottomReached: false,
  457. direction: '',
  458. startY: 0,
  459. startScrollTop: 0,
  460. currentY: 0,
  461. topStatus: '',
  462. bottomStatus: ''
  463. };
  464. },
  465. computed: {
  466. transform: function transform() {
  467. return this.translate === 0 ? null : 'translate3d(0, ' + this.translate + 'px, 0)';
  468. }
  469. },
  470. watch: {
  471. topStatus: function topStatus(val) {
  472. this.$emit('top-status-change', val);
  473. switch (val) {
  474. case 'pull':
  475. this.topText = this.topPullText;
  476. break;
  477. case 'drop':
  478. this.topText = this.topDropText;
  479. break;
  480. case 'loading':
  481. this.topText = this.topLoadingText;
  482. break;
  483. }
  484. },
  485. bottomStatus: function bottomStatus(val) {
  486. this.$emit('bottom-status-change', val);
  487. switch (val) {
  488. case 'pull':
  489. this.bottomText = this.bottomPullText;
  490. break;
  491. case 'drop':
  492. this.bottomText = this.bottomDropText;
  493. break;
  494. case 'loading':
  495. this.bottomText = this.bottomLoadingText;
  496. break;
  497. }
  498. }
  499. },
  500. methods: {
  501. onTopLoaded: function onTopLoaded() {
  502. var this$1 = this;
  503. this.translate = 0;
  504. setTimeout(function () {
  505. this$1.topStatus = 'pull';
  506. }, 200);
  507. },
  508. onBottomLoaded: function onBottomLoaded() {
  509. var this$1 = this;
  510. this.bottomStatus = 'pull';
  511. this.bottomDropped = false;
  512. this.$nextTick(function () {
  513. if (this$1.scrollEventTarget === window) {
  514. document.body.scrollTop += 50;
  515. } else {
  516. this$1.scrollEventTarget.scrollTop += 50;
  517. }
  518. this$1.translate = 0;
  519. });
  520. if (!this.bottomAllLoaded && !this.containerFilled) {
  521. this.fillContainer();
  522. }
  523. },
  524. getScrollEventTarget: function getScrollEventTarget(element) {
  525. var currentNode = element;
  526. while (currentNode && currentNode.tagName !== 'HTML' &&
  527. currentNode.tagName !== 'BODY' && currentNode.nodeType === 1) {
  528. var overflowY = document.defaultView.getComputedStyle(currentNode).overflowY;
  529. if (overflowY === 'scroll' || overflowY === 'auto') {
  530. return currentNode;
  531. }
  532. currentNode = currentNode.parentNode;
  533. }
  534. return window;
  535. },
  536. getScrollTop: function getScrollTop(element) {
  537. if (element === window) {
  538. return Math.max(window.pageYOffset || 0, document.documentElement.scrollTop);
  539. } else {
  540. return element.scrollTop;
  541. }
  542. },
  543. bindTouchEvents: function bindTouchEvents() {
  544. this.$el.addEventListener('touchstart', this.handleTouchStart);
  545. this.$el.addEventListener('touchmove', this.handleTouchMove);
  546. this.$el.addEventListener('touchend', this.handleTouchEnd);
  547. },
  548. init: function init() {
  549. this.topStatus = 'pull';
  550. this.bottomStatus = 'pull';
  551. this.topText = this.topPullText;
  552. this.scrollEventTarget = this.getScrollEventTarget(this.$el);
  553. if (typeof this.bottomMethod === 'function') {
  554. this.fillContainer();
  555. this.bindTouchEvents();
  556. }
  557. if (typeof this.topMethod === 'function') {
  558. this.bindTouchEvents();
  559. }
  560. },
  561. fillContainer: function fillContainer() {
  562. var this$1 = this;
  563. if (this.autoFill) {
  564. this.$nextTick(function () {
  565. if (this$1.scrollEventTarget === window) {
  566. this$1.containerFilled = this$1.$el.getBoundingClientRect().bottom >=
  567. document.documentElement.getBoundingClientRect().bottom;
  568. } else {
  569. this$1.containerFilled = this$1.$el.getBoundingClientRect().bottom >=
  570. this$1.scrollEventTarget.getBoundingClientRect().bottom;
  571. }
  572. if (!this$1.containerFilled) {
  573. this$1.bottomStatus = 'loading';
  574. this$1.bottomMethod();
  575. }
  576. });
  577. }
  578. },
  579. checkBottomReached: function checkBottomReached() {
  580. if (this.scrollEventTarget === window) {
  581. return document.body.scrollTop + document.documentElement.clientHeight >= document.body.scrollHeight;
  582. } else {
  583. return this.$el.getBoundingClientRect().bottom <= this.scrollEventTarget.getBoundingClientRect().bottom + 1;
  584. }
  585. },
  586. handleTouchStart: function handleTouchStart(event) {
  587. this.startY = event.touches[0].clientY;
  588. this.startScrollTop = this.getScrollTop(this.scrollEventTarget);
  589. this.bottomReached = false;
  590. if (this.topStatus !== 'loading') {
  591. this.topStatus = 'pull';
  592. this.topDropped = false;
  593. }
  594. if (this.bottomStatus !== 'loading') {
  595. this.bottomStatus = 'pull';
  596. this.bottomDropped = false;
  597. }
  598. },
  599. handleTouchMove: function handleTouchMove(event) {
  600. if (this.startY < this.$el.getBoundingClientRect().top && this.startY > this.$el.getBoundingClientRect().bottom) {
  601. return;
  602. }
  603. this.currentY = event.touches[0].clientY;
  604. var distance = (this.currentY - this.startY) / this.distanceIndex;
  605. this.direction = distance > 0 ? 'down' : 'up';
  606. if (typeof this.topMethod === 'function' && this.direction === 'down' &&
  607. this.getScrollTop(this.scrollEventTarget) === 0 && this.topStatus !== 'loading') {
  608. event.preventDefault();
  609. event.stopPropagation();
  610. if (this.maxDistance > 0) {
  611. this.translate = distance <= this.maxDistance ? distance - this.startScrollTop : this.translate;
  612. } else {
  613. this.translate = distance - this.startScrollTop;
  614. }
  615. if (this.translate < 0) {
  616. this.translate = 0;
  617. }
  618. this.topStatus = this.translate >= this.topDistance ? 'drop' : 'pull';
  619. }
  620. if (this.direction === 'up') {
  621. this.bottomReached = this.bottomReached || this.checkBottomReached();
  622. }
  623. if (typeof this.bottomMethod === 'function' && this.direction === 'up' &&
  624. this.bottomReached && this.bottomStatus !== 'loading' && !this.bottomAllLoaded) {
  625. event.preventDefault();
  626. event.stopPropagation();
  627. if (this.maxDistance > 0) {
  628. this.translate = Math.abs(distance) <= this.maxDistance
  629. ? this.getScrollTop(this.scrollEventTarget) - this.startScrollTop + distance : this.translate;
  630. } else {
  631. this.translate = this.getScrollTop(this.scrollEventTarget) - this.startScrollTop + distance;
  632. }
  633. if (this.translate > 0) {
  634. this.translate = 0;
  635. }
  636. this.bottomStatus = -this.translate >= this.bottomDistance ? 'drop' : 'pull';
  637. }
  638. this.$emit('translate-change', this.translate);
  639. },
  640. handleTouchEnd: function handleTouchEnd() {
  641. if (this.direction === 'down' && this.getScrollTop(this.scrollEventTarget) === 0 && this.translate > 0) {
  642. this.topDropped = true;
  643. if (this.topStatus === 'drop') {
  644. this.translate = '50';
  645. this.topStatus = 'loading';
  646. this.topMethod();
  647. } else {
  648. this.translate = '0';
  649. this.topStatus = 'pull';
  650. }
  651. }
  652. if (this.direction === 'up' && this.bottomReached && this.translate < 0) {
  653. this.bottomDropped = true;
  654. this.bottomReached = false;
  655. if (this.bottomStatus === 'drop') {
  656. this.translate = '-50';
  657. this.bottomStatus = 'loading';
  658. this.bottomMethod();
  659. } else {
  660. this.translate = '0';
  661. this.bottomStatus = 'pull';
  662. }
  663. }
  664. this.$emit('translate-change', this.translate);
  665. this.direction = '';
  666. }
  667. },
  668. mounted: function mounted() {
  669. this.init();
  670. }
  671. };
  672. /***/ }
  673. /******/ });