mirror of
https://github.com/nextcloud/server.git
synced 2026-02-20 00:12:30 -05:00
refactor(ExampleContentSettingsSection): migrate component to script-setup
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
This commit is contained in:
parent
b856adee88
commit
954cdd4621
1 changed files with 14 additions and 30 deletions
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Reference in a new issue