-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex-vue.js
71 lines (64 loc) · 1.73 KB
/
index-vue.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
import RbIdentity from "./src/ui/RbIdentity.vue";
import RbState from "./src/ui/RbState.vue";
import RbServices from "./src/ui/RbServices.vue";
import RbAbout from "./src/ui/RbAbout.vue";
import RbAboutItem from "./src/ui/RbAboutItem.vue";
import RbTreeView from "./src/ui/RbTreeView.vue";
import RbWebSocket from "./src/ui/RbWebSocket.vue";
import RbApiDialog from "./src/ui/RbApiDialog.vue";
import RbDialogRow from "./src/ui/RbDialogRow.vue";
var components = {
RbAbout,
RbAboutItem,
RbApiDialog,
RbDialogRow,
RbIdentity,
RbServices,
RbState,
RbTreeView,
RbWebSocket,
}
const RbApiMixin = require( "./src/ui/mixins/rb-api-mixin.js" );
const RbServiceMixin = require( "./src/ui/mixins/rb-service-mixin.js" );
const RbAboutMixin = require( "./src/ui/mixins/rb-about-mixin.js" );
var mixins = {
RbAboutMixin,
RbServiceMixin,
RbApiMixin,
}
function toKebabCase(id) {
return id.replace(/([A-Z])/g, '-$1').toLowerCase().replace(/^-/,'');
}
function aboutRoutes(comps = components) {
return Object.keys(comps).map(key => {
var component = comps[key];
return {
path: '/' + toKebabCase(key),
component: component,
props: {
about: true,
},
};
})
}
function aboutSidebar(comps = components) {
return Object.keys(comps).map( key => ({
title: key,
href: "/" + toKebabCase(key),
}));
}
var methods = {
aboutRoutes,
aboutSidebar,
toKebabCase,
}
function plugin(Vue, options) {
var keys = Object.keys(components);
keys.forEach( key => Vue.component(key, components[key]));
}
export default Object.assign({
install: plugin,
components,
methods,
mixins,
}, mixins);