-
Notifications
You must be signed in to change notification settings - Fork 370
/
Copy pathindex.js
35 lines (27 loc) · 988 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import config from './config';
import InfiniteLoading from './components/InfiniteLoading.vue';
function syncModeFromVue(Vue) {
config.mode = Vue.config.productionTip ? 'development' : 'production';
}
Object.defineProperty(InfiniteLoading, 'install', {
configurable: false,
enumerable: false,
value(Vue, options) {
// override default props
Object.assign(config.props, options && options.props);
// override default slots
Object.assign(config.slots, options && options.slots);
// override default system settings
Object.assign(config.system, options && options.system);
// register component
Vue.component('InfiniteLoading', InfiniteLoading);
syncModeFromVue(Vue);
},
});
// register component automatically if there has global Vue
/* istanbul ignore else */
if (typeof window !== 'undefined' && window.Vue) {
window.Vue.component('InfiniteLoading', InfiniteLoading);
syncModeFromVue(window.Vue);
}
export default InfiniteLoading;