@cafee/component
Advanced tools
Comparing version 1.0.0 to 1.0.2
18
index.js
export default class Component { | ||
constructor (component) { | ||
constructor (component, space) { | ||
this.cache = component | ||
this.space = space | ||
return {install: this.install} | ||
@@ -8,6 +9,17 @@ } | ||
install (Vue) { | ||
for (let i in this.cache) { | ||
Vue.component(`${i}`, this.cache[i]) | ||
if (!this.cache) { | ||
return Vue | ||
} | ||
switch (this.cache.constructor) { | ||
case Array: | ||
return this.space.map(name, index => Vue.component(name, this.cache[index])) | ||
case Object: | ||
for (let i in this.cache) { | ||
Vue.component(i, this.cache[i]) | ||
} | ||
break | ||
default: | ||
Vue.component(space, component) | ||
} | ||
} | ||
} |
{ | ||
"name": "@cafee/component", | ||
"version": "1.0.0", | ||
"description": "", | ||
"version": "1.0.2", | ||
"description": "Easy Create Vue Component", | ||
"main": "index.js", | ||
@@ -6,0 +6,0 @@ "scripts": { |
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
1208
3
23
1
10