cancel the components prefix

This commit is contained in:
young 2017-03-15 11:22:33 +08:00
parent 75ed74e9a6
commit fb189f1650

View file

@ -116,16 +116,13 @@ const iview = {
Tree, Tree,
Upload Upload
}; };
let defaultOptions = {
componentPrefix: ''
};
const install = function (Vue, opts = {}) { const install = function (Vue, opts = {}) {
opts = Object.assign(defaultOptions, (opts || {}));
locale.use(opts.locale); locale.use(opts.locale);
locale.i18n(opts.i18n); locale.i18n(opts.i18n);
Object.keys(iview).forEach((key) => { Object.keys(iview).forEach((key) => {
Vue.component(`${opts.componentPrefix.toUpperCase()}${key}`, iview[key]); Vue.component(key, iview[key]);
}); });
Vue.prototype.$Loading = LoadingBar; Vue.prototype.$Loading = LoadingBar;