feat: refresh market-config

This commit is contained in:
Vlad Stan 2023-07-17 18:06:37 +03:00
parent 3ffb055e94
commit d22c15d7a7
4 changed files with 67 additions and 66 deletions

View file

@ -95,12 +95,14 @@
<strong>UI Configurations</strong>
</div>
<q-input @change="updateUiConfig" outlined v-model="configData.ui.picture" type="text" label="Logo" class="q-mb-md">
<q-input @change="updateUiConfig" outlined v-model="configData.ui.picture" type="text" label="Logo"
class="q-mb-md">
</q-input>
<q-input @change="updateUiConfig" outlined v-model="configData.ui.banner" type="text" label="Banner" class="q-mb-md">
<q-input @change="updateUiConfig" outlined v-model="configData.ui.banner" type="text" label="Banner"
class="q-mb-md">
</q-input>
<q-select @change="updateUiConfig" filled v-model="configData.ui.theme" hint="Choose marketplace theme"
:options="themeOptions" label="Marketplace Theme"></q-select>
<q-select @input="updateUiConfig" filled v-model="configData.ui.theme"
hint="Choose marketplace theme" :options="themeOptions" label="Marketplace Theme"></q-select>
</q-tab-panel>

View file

@ -2,7 +2,7 @@ async function marketConfig(path) {
const template = await loadTemplateAsync(path)
Vue.component('market-config', {
name: 'market-config',
props: ['merchants', 'relays', 'config'],
props: ['merchants', 'relays', 'config-ui'],
template,
data: function () {
@ -82,12 +82,17 @@ async function marketConfig(path) {
this.$emit('remove-relay', relay)
},
updateUiConfig: function () {
console.log('### this.info', this.configData)
this.$emit('ui-config-update', this.configData)
const { name, about, ui } = this.configData
console.log('### this.info', { name, about, ui })
this.$emit('ui-config-update', { name, about, ui })
}
},
created: async function () {
this.configData = { ...this.configData, ...this.config }
console.log('### this.configUi', this.configUi)
if (this.configUi) {
this.configData = { ...this.configData, ...this.configUi }
}
}
})
}