瀏覽代碼

Loading: fix export module

qingwei.li 8 年之前
父節點
當前提交
3003aaa426
共有 3 個文件被更改,包括 7 次插入4 次删除
  1. 1 2
      build/bin/build-entry.js
  2. 5 0
      packages/loading/index.js
  3. 1 2
      src/index.js

+ 1 - 2
build/bin/build-entry.js

@@ -39,8 +39,7 @@ module.exports = {
   version: '{{version}}',
   locale: locale.use,
   install,
-  Loading: Loading.directive,
-  LoadingService: Loading.service,
+  Loading,
 {{list}}
 };
 `;

+ 5 - 0
packages/loading/index.js

@@ -1,6 +1,11 @@
 import directive from './src/directive';
 import service from './src/index';
+
 export default {
+  install(Vue) {
+    Vue.use(directive);
+    Vue.prototype.$loading = service;
+  },
   directive,
   service
 };

+ 1 - 2
src/index.js

@@ -134,8 +134,7 @@ module.exports = {
   version: '1.0.1',
   locale: locale.use,
   install,
-  Loading: Loading.directive,
-  LoadingService: Loading.service,
+  Loading,
   Pagination,
   Dialog,
   Autocomplete,