1
1
<script setup lang="ts">
2
+ import { computed } from ' vue' ;
3
+
2
4
import { $t } from ' @vben-core/locales' ;
3
5
4
6
import InputItem from ' ../input-item.vue' ;
@@ -8,6 +10,8 @@ defineOptions({
8
10
name: ' PreferenceBreadcrumbConfig' ,
9
11
});
10
12
13
+ const props = defineProps <{ disabled: boolean }>();
14
+
11
15
const copyrightEnable = defineModel <boolean >(' copyrightEnable' );
12
16
const copyrightDate = defineModel <string >(' copyrightDate' );
13
17
const copyrightIcp = defineModel <string >(' copyrightIcp' );
@@ -16,27 +20,29 @@ const copyrightCompanyName = defineModel<string>('copyrightCompanyName');
16
20
const copyrightCompanySiteLink = defineModel <string >(
17
21
' copyrightCompanySiteLink' ,
18
22
);
23
+
24
+ const itemDisabled = computed (() => props .disabled || ! copyrightEnable .value );
19
25
</script >
20
26
21
27
<template >
22
- <SwitchItem v-model =" copyrightEnable" >
28
+ <SwitchItem v-model =" copyrightEnable" :disabled = " disabled " >
23
29
{{ $t('preferences.copyright.enable') }}
24
30
</SwitchItem >
25
31
26
- <InputItem v-model =" copyrightCompanyName" :disabled =" !copyrightEnable " >
32
+ <InputItem v-model =" copyrightCompanyName" :disabled =" itemDisabled " >
27
33
{{ $t('preferences.copyright.company-name') }}
28
34
</InputItem >
29
- <InputItem v-model =" copyrightCompanySiteLink" :disabled =" !copyrightEnable " >
35
+ <InputItem v-model =" copyrightCompanySiteLink" :disabled =" itemDisabled " >
30
36
{{ $t('preferences.copyright.company-site-link') }}
31
37
</InputItem >
32
- <InputItem v-model =" copyrightDate" :disabled =" !copyrightEnable " >
38
+ <InputItem v-model =" copyrightDate" :disabled =" itemDisabled " >
33
39
{{ $t('preferences.copyright.date') }}
34
40
</InputItem >
35
41
36
- <InputItem v-model =" copyrightIcp" :disabled =" !copyrightEnable " >
42
+ <InputItem v-model =" copyrightIcp" :disabled =" itemDisabled " >
37
43
{{ $t('preferences.copyright.icp') }}
38
44
</InputItem >
39
- <InputItem v-model =" copyrightIcpLink" :disabled =" !copyrightEnable " >
45
+ <InputItem v-model =" copyrightIcpLink" :disabled =" itemDisabled " >
40
46
{{ $t('preferences.copyright.icp-link') }}
41
47
</InputItem >
42
48
</template >
0 commit comments