1 | 'use strict';
|
2 |
|
3 | exports.__esModule = true;
|
4 |
|
5 | exports.default = function (instance, callback) {
|
6 | var speed = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 300;
|
7 | var once = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
8 |
|
9 | if (!instance || !callback) throw new Error('instance & callback is required');
|
10 | var called = false;
|
11 | var afterLeaveCallback = function afterLeaveCallback() {
|
12 | if (called) return;
|
13 | called = true;
|
14 | if (callback) {
|
15 | callback.apply(null, arguments);
|
16 | }
|
17 | };
|
18 | if (once) {
|
19 | instance.$once('after-leave', afterLeaveCallback);
|
20 | } else {
|
21 | instance.$on('after-leave', afterLeaveCallback);
|
22 | }
|
23 | setTimeout(function () {
|
24 | afterLeaveCallback();
|
25 | }, speed + 100);
|
26 | };
|
27 |
|
28 | ; |
29 |
|
30 |
|
31 |
|
32 |
|
33 |
|
34 |
|
35 |
|
\ | No newline at end of file |