@afeefa/vue-app 0.0.158 → 0.0.159
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.159
|
package/package.json
CHANGED
package/src-admin/AfeefaAdmin.js
CHANGED
@@ -11,6 +11,7 @@ import { adminConfig } from './config/AdminConfig'
|
|
11
11
|
import routeConfigPlugin from './config/routing'
|
12
12
|
import vuetify from './config/vuetify'
|
13
13
|
import { authPlugin } from './plugins/AuthPlugin'
|
14
|
+
import { configPlugin } from './plugins/ConfigPlugin'
|
14
15
|
|
15
16
|
Vue.config.productionTip = false
|
16
17
|
|
@@ -27,6 +28,11 @@ export class AfeefaAdmin {
|
|
27
28
|
return this
|
28
29
|
}
|
29
30
|
|
31
|
+
customConfig (customConfig) {
|
32
|
+
adminConfig.config = customConfig
|
33
|
+
return this
|
34
|
+
}
|
35
|
+
|
30
36
|
routing (routeConfigCallback) {
|
31
37
|
this._routeConfigCallback = routeConfigCallback
|
32
38
|
return this
|
@@ -51,6 +57,8 @@ export class AfeefaAdmin {
|
|
51
57
|
// set app config
|
52
58
|
adminConfig.app = this._appConfig
|
53
59
|
|
60
|
+
Vue.use(configPlugin)
|
61
|
+
|
54
62
|
// authenticate current user before doing any gui-voodo
|
55
63
|
if (this._authService) {
|
56
64
|
adminConfig.authService = this._authService
|
@@ -88,7 +96,7 @@ export class AfeefaAdmin {
|
|
88
96
|
|
89
97
|
// load initial data
|
90
98
|
if (this._initCallback) {
|
91
|
-
await this._initCallback()
|
99
|
+
await this._initCallback(this)
|
92
100
|
}
|
93
101
|
|
94
102
|
// setup router, routes and breadcrumb
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import { adminConfig } from '../config/AdminConfig'
|
2
|
+
|
3
|
+
class ConfigPlugin {
|
4
|
+
install (Vue) {
|
5
|
+
Object.defineProperty(Vue.prototype, '$config', {
|
6
|
+
get () {
|
7
|
+
return adminConfig.config
|
8
|
+
}
|
9
|
+
})
|
10
|
+
}
|
11
|
+
}
|
12
|
+
|
13
|
+
export const configPlugin = new ConfigPlugin()
|