8000 refactor: update exports · coreui/coreui-vue@077413f · GitHub
[go: up one dir, main page]

Skip to content

Commit 077413f

Browse files
committed
refactor: update exports
1 parent 72f1a61 commit 077413f

File tree

1 file changed

+7
-29
lines changed

1 file changed

+7
-29
lines changed

packages/coreui-vue/src/index.ts

Lines changed: 7 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,22 @@
1-
//@ts-nocheck
21
import { App } from 'vue'
32
import * as Components from './components'
4-
import { vcplaceholder, vcpopover, vctooltip } from './directives'
5-
6-
const removeKeysFromObject = (object, keys) => {
7-
return Object.entries(object).reduce((obj, [key, value]) => {
8-
if (!keys.includes(key) && !keys.includes(value.name)) {
9-
obj[key] = value
10-
}
11-
return obj
12-
}, {})
13-
}
3+
import * as Directives from './directives'
144

155
const CoreuiVue = {
16-
install: (app: App, options: any): void => {
17-
let pluginComponents = Components
18-
// let pluginDirectives = Directives
19-
20-
const toRemove = options && options.remove ? options.remove : null
21-
if (toRemove && Array.isArray(toRemove)) {
22-
pluginComponents = removeKeysFromObject(Components, toRemove)
23-
// pluginDirectives = removeKeysFromObject(Directives, toRemove)
6+
install: (app: App): void => {
7+
for (const key in Components) {
8+
app.component(key, Components[key])
249
}
2510

26-
for (const plugin in pluginComponents) {
27-
app.component(plugin, Components[plugin])
11+
for (const key in Directives) {
12+
app.directive(key, Directives[key])
2813
}
29-
// for (const directive in pluginDirectives) {
30-
// app.directive(directive, Directives[directive])
31-
// }
32-
33-
app.directive('c-placeholder', vcplaceholder)
34-
app.directive('c-popover', vcpopover)
35-
app.directive('c-tooltip', vctooltip)
3614
},
3715
}
3816

3917
// Export library
4018
export default CoreuiVue
4119

42-
//Export components
20+
// Export components & directives
4321
export * from './components'
4422
export * from './directives'

0 commit comments

Comments
 (0)
0