add iview.install()

This commit is contained in:
jingsam 2016-11-03 10:19:35 +08:00
parent 49f124ae88
commit 343abe50e7
3 changed files with 17 additions and 6 deletions

View file

@ -80,4 +80,15 @@ const iview = {
iSelect: Select
};
module.exports = iview;
const install = function (Vue) {
Object.keys(iview).forEach((key) => {
Vue.component(key, iview[name])
})
}
// auto install
if (typeof window !== 'undefined' && window.Vue) {
install(window.Vue);
};
module.exports = Object.assign(iview, {install});