Skip to content

Commit 5646a50

Browse files
committed
fix(projects): fix watermark settings
1 parent 217a3bb commit 5646a50

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/App.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const naiveDateLocale = computed(() => {
2525
2626
const watermarkProps = computed<WatermarkProps>(() => {
2727
return {
28-
content: themeStore.watermark.text,
28+
content: themeStore.watermark?.text || 'SoybeanAdmin',
2929
cross: true,
3030
fullscreen: true,
3131
fontSize: 16,
@@ -50,7 +50,7 @@ const watermarkProps = computed<WatermarkProps>(() => {
5050
>
5151
<AppProvider>
5252
<RouterView class="bg-layout" />
53-
<NWatermark v-if="themeStore.watermark.visible" v-bind="watermarkProps" />
53+
<NWatermark v-if="themeStore.watermark?.visible" v-bind="watermarkProps" />
5454
</AppProvider>
5555
</NConfigProvider>
5656
</template>

src/layouts/modules/theme-drawer/modules/page-fun.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,10 @@ const isWrapperScrollMode = computed(() => themeStore.layout.scrollMode === 'wra
101101
>
102102
<NSwitch v-model:value="themeStore.footer.right" />
103103
</SettingItem>
104-
<SettingItem key="8" :label="$t('theme.watermark.visible')">
104+
<SettingItem v-if="themeStore.watermark" key="8" :label="$t('theme.watermark.visible')">
105105
<NSwitch v-model:value="themeStore.watermark.visible" />
106106
</SettingItem>
107-
<SettingItem v-if="themeStore.watermark.visible" key="8-1" :label="$t('theme.watermark.text')">
107+
<SettingItem v-if="themeStore.watermark?.visible" key="8-1" :label="$t('theme.watermark.text')">
108108
<NInput
109109
v-model:value="themeStore.watermark.text"
110110
autosize

src/typings/app.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ declare namespace App {
9696
right: boolean;
9797
};
9898
/** Watermark */
99-
watermark: {
99+
watermark?: {
100100
/** Whether to show the watermark */
101101
visible: boolean;
102102
/** Watermark text */

0 commit comments

Comments
 (0)