refactor(ExampleContentSettingsSection): migrate component to script-setup

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
This commit is contained in:
Ferdinand Thiessen 2025-10-22 23:08:28 +02:00
parent b856adee88
commit 954cdd4621
No known key found for this signature in database
GPG key ID: 45FAE7268762B400

View file

@ -3,39 +3,23 @@
- SPDX-License-Identifier: AGPL-3.0-or-later
-->
<template>
<NcSettingsSection
id="example-content"
:name="$t('dav', 'Example content')"
class="example-content-setting"
:description="$t('dav', 'Example content serves to showcase the features of Nextcloud. Default content is shipped with Nextcloud, and can be replaced by custom content.')">
<ExampleContactSettings v-if="hasContactsApp" />
<ExampleEventSettings v-if="hasCalendarApp" />
</NcSettingsSection>
</template>
<script>
<script setup lang="ts">
import { loadState } from '@nextcloud/initial-state'
import { t } from '@nextcloud/l10n'
import { NcSettingsSection } from '@nextcloud/vue'
import ExampleContactSettings from '../components/ExampleContactSettings.vue'
import ExampleEventSettings from '../components/ExampleEventSettings.vue'
export default {
name: 'ExampleContentSettingsSection',
components: {
NcSettingsSection,
ExampleContactSettings,
ExampleEventSettings,
},
computed: {
hasContactsApp() {
return loadState('dav', 'contactsEnabled')
},
hasCalendarApp() {
return loadState('dav', 'calendarEnabled')
},
},
}
const hasContactsApp = loadState('dav', 'contactsEnabled')
const hasCalendarApp = loadState('dav', 'calendarEnabled')
</script>
<template>
<NcSettingsSection
id="example-content"
:name="t('dav', 'Example content')"
:description="t('dav', 'Example content serves to showcase the features of Nextcloud. Default content is shipped with Nextcloud, and can be replaced by custom content.')">
<ExampleContactSettings v-if="hasContactsApp" />
<ExampleEventSettings v-if="hasCalendarApp" />
</NcSettingsSection>
</template>