Allow logo and accentColor to be set in config/runtimeConfig
This commit is contained in:
parent
6cd47a88c0
commit
61720b8440
9 changed files with 71 additions and 27 deletions
23
src/main.js
23
src/main.js
|
|
@ -1,6 +1,5 @@
|
|||
import Vue from 'vue'
|
||||
import App from './App.vue'
|
||||
import vuetify from './plugins/vuetify';
|
||||
import store from './store'
|
||||
import i18n from './plugins/lang';
|
||||
import router from './router'
|
||||
|
|
@ -15,6 +14,7 @@ import VueResize from 'vue-resize';
|
|||
import 'vue-resize/dist/vue-resize.css';
|
||||
import VueClipboard from 'vue-clipboard2'
|
||||
import VueSanitize from "vue-sanitize";
|
||||
import createVuetify from './plugins/vuetify';
|
||||
|
||||
var defaultOptions = VueSanitize.defaults;
|
||||
defaultOptions.disallowedTagsMode = "recursiveEscape";
|
||||
|
|
@ -26,11 +26,18 @@ Vue.config.productionTip = false
|
|||
Vue.use(VueResize);
|
||||
Vue.use(VEmojiPicker);
|
||||
Vue.use(matrix, { store: store, i18n: i18n });
|
||||
// eslint-disable-next-line
|
||||
Vue.use(config, globalThis.window.location.origin); // Use this before cleaninsights below, it depends on config!
|
||||
|
||||
const configLoadedPromise = new Promise((resolve, ignoredreject) => {
|
||||
// eslint-disable-next-line
|
||||
Vue.use(config, globalThis.window.location.origin, (config) => {
|
||||
resolve(config);
|
||||
}); // Use this before cleaninsights below, it depends on config!
|
||||
});
|
||||
Vue.use(analytics);
|
||||
Vue.use(VueClipboard);
|
||||
|
||||
const vuetify = createVuetify(config);
|
||||
|
||||
// Add bubble functionality to custom events.
|
||||
// From here: https://stackoverflow.com/questions/41993508/vuejs-bubbling-custom-events
|
||||
Vue.use((Vue) => {
|
||||
|
|
@ -161,7 +168,7 @@ Vue.directive('longTap', {
|
|||
|
||||
Vue.use(navigation, router);
|
||||
|
||||
new Vue({
|
||||
const vueInstance = new Vue({
|
||||
vuetify,
|
||||
store,
|
||||
i18n,
|
||||
|
|
@ -170,4 +177,10 @@ new Vue({
|
|||
config,
|
||||
analytics,
|
||||
render: h => h(App)
|
||||
}).$mount('#app');
|
||||
});
|
||||
vueInstance.$vuetify.theme.themes.light.primary = vueInstance.$config.accentColor;
|
||||
configLoadedPromise.then((config) => {
|
||||
vueInstance.$vuetify.theme.themes.light.primary = config.accentColor;
|
||||
vueInstance.$mount('#app');
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue