default value for hasConfig is false and the emit update for the URL dashboard widget and only loads the config component if the dashboard widget actually has a config

This commit is contained in:
SimonGschnell
2024-10-14 13:36:31 +02:00
parent b0e96fbab1
commit 9ed08fb40c
2 changed files with 7 additions and 3 deletions
+3 -3
View File
@@ -12,7 +12,7 @@ export default {
widget: null,
tmpConfig: {},
isLoading: false,
hasConfig: true,
hasConfig: false,
sharedData: null,
}),
emits: [
@@ -117,10 +117,10 @@ export default {
</div>
</div>
<div v-if="ready" class="card-body overflow-hidden">
<component :is="component" v-model:shared-data="sharedData" :config="arguments" :width="width" :height="height" @setConfig="setConfig" @change="changeConfigManually"></component>
<component :is="component" v-model:shared-data="sharedData" :config="arguments" :width="width" :height="height" @setConfig="setConfig" @change="changeConfigManually"></component>
</div>
<div v-else class="card-body overflow-hidden text-center d-flex flex-column justify-content-center"><i class="fa-solid fa-spinner fa-pulse fa-3x"></i></div>
<bs-modal ref="config">
<bs-modal v-if="hasConfig" ref="config">
<template v-slot:title>
{{ widget ? 'Config for ' + widget.setup.name : '' }}
</template>
@@ -71,6 +71,10 @@ export default {
async mounted() {
await this.fetchBookmarks();
},
created()
{
this.$emit('setConfig', true);
},
template: /*html*/ `
<div class="widgets-url w-100 h-100">
<div v-if="configMode">