11<script setup lang="ts">
2+ import { computed } from ' vue' ;
3+
24import { $t } from ' @vben-core/locales' ;
35
46import InputItem from ' ../input-item.vue' ;
@@ -8,6 +10,8 @@ defineOptions({
810 name: ' PreferenceBreadcrumbConfig' ,
911});
1012
13+ const props = defineProps <{ disabled: boolean }>();
14+
1115const copyrightEnable = defineModel <boolean >(' copyrightEnable' );
1216const copyrightDate = defineModel <string >(' copyrightDate' );
1317const copyrightIcp = defineModel <string >(' copyrightIcp' );
@@ -16,27 +20,29 @@ const copyrightCompanyName = defineModel<string>('copyrightCompanyName');
1620const copyrightCompanySiteLink = defineModel <string >(
1721 ' copyrightCompanySiteLink' ,
1822);
23+
24+ const itemDisabled = computed (() => props .disabled || ! copyrightEnable .value );
1925 </script >
2026
2127<template >
22- <SwitchItem v-model =" copyrightEnable" >
28+ <SwitchItem v-model =" copyrightEnable" :disabled = " disabled " >
2329 {{ $t('preferences.copyright.enable') }}
2430 </SwitchItem >
2531
26- <InputItem v-model =" copyrightCompanyName" :disabled =" !copyrightEnable " >
32+ <InputItem v-model =" copyrightCompanyName" :disabled =" itemDisabled " >
2733 {{ $t('preferences.copyright.company-name') }}
2834 </InputItem >
29- <InputItem v-model =" copyrightCompanySiteLink" :disabled =" !copyrightEnable " >
35+ <InputItem v-model =" copyrightCompanySiteLink" :disabled =" itemDisabled " >
3036 {{ $t('preferences.copyright.company-site-link') }}
3137 </InputItem >
32- <InputItem v-model =" copyrightDate" :disabled =" !copyrightEnable " >
38+ <InputItem v-model =" copyrightDate" :disabled =" itemDisabled " >
3339 {{ $t('preferences.copyright.date') }}
3440 </InputItem >
3541
36- <InputItem v-model =" copyrightIcp" :disabled =" !copyrightEnable " >
42+ <InputItem v-model =" copyrightIcp" :disabled =" itemDisabled " >
3743 {{ $t('preferences.copyright.icp') }}
3844 </InputItem >
39- <InputItem v-model =" copyrightIcpLink" :disabled =" !copyrightEnable " >
45+ <InputItem v-model =" copyrightIcpLink" :disabled =" itemDisabled " >
4046 {{ $t('preferences.copyright.icp-link') }}
4147 </InputItem >
4248</template >
0 commit comments