config(compontent)): can customer the compontent prefix
This commit is contained in:
parent
5016847870
commit
51155ea812
1 changed files with 5 additions and 2 deletions
|
@ -116,13 +116,16 @@ const iview = {
|
|||
Tree,
|
||||
Upload
|
||||
};
|
||||
|
||||
const defaultOptions = {
|
||||
componentPrefix: 'i'
|
||||
}
|
||||
const install = function (Vue, opts = {}) {
|
||||
opts = Object.assign(defaultOptions, (opts || {}))
|
||||
locale.use(opts.locale);
|
||||
locale.i18n(opts.i18n);
|
||||
|
||||
Object.keys(iview).forEach((key) => {
|
||||
Vue.component(key, iview[key]);
|
||||
Vue.component(`${opts.componentPrefix.toUpperCase()}${key}`, iview[key]);
|
||||
});
|
||||
|
||||
Vue.prototype.$Loading = LoadingBar;
|
||||
|
|
Loading…
Add table
Reference in a new issue