diff --git a/build/bin/build-entry.js b/build/bin/build-entry.js index ee77c0785..173b2f95a 100644 --- a/build/bin/build-entry.js +++ b/build/bin/build-entry.js @@ -19,8 +19,9 @@ const install = function(Vue, opts = {}) { {{install}} - Vue.use(Loading); + Vue.use(Loading.directive); + Vue.prototype.$loading = Loading.service; Vue.prototype.$msgbox = MessageBox; Vue.prototype.$alert = MessageBox.alert; Vue.prototype.$confirm = MessageBox.confirm; @@ -38,6 +39,8 @@ module.exports = { version: '{{version}}', locale: locale.use, install, + Loading: Loading.directive, + LoadingService: Loading.service, {{list}} }; `; @@ -65,7 +68,7 @@ ComponentNames.forEach(name => { })); } - listTemplate.push(` ${componentName}`); + if (componentName !== 'Loading') listTemplate.push(` ${componentName}`); }); var template = render(MAIN_TEMPLATE, { diff --git a/examples/docs/en-US/loading.md b/examples/docs/en-US/loading.md index 1b1dc13b4..0a3b819eb 100644 --- a/examples/docs/en-US/loading.md +++ b/examples/docs/en-US/loading.md @@ -40,7 +40,7 @@ Show animation while loading data. Displays animation in a container (such as a table) while loading data. -:::demo We provide a custom directive `v-loading`. You just need to bind a `boolean` value to it. By default, the loading mask will append to the element where the directive is used. Adding the `body` modifier makes the mask append to the body element. +:::demo Element provides two ways to invoke Loading: directive and service. For the custom directive `v-loading`, you just need to bind a `boolean` value to it. By default, the loading mask will append to the element where the directive is used. Adding the `body` modifier makes the mask append to the body element. ```html