File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed
resources/js/components/fieldtypes Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change 11<script setup>
22import { Fieldtype } from ' @statamic/cms' ;
33import { Heading , Description , Icon } from ' @statamic/cms/ui' ;
4+ import { computed } from ' vue' ;
45
56const emit = defineEmits (Fieldtype .emits );
67const props = defineProps (Fieldtype .props );
78const { expose } = Fieldtype .use (emit, props);
89defineExpose (expose);
10+
11+ const hasDetails = computed (() => Object .entries (props .value .details ).length > 0 );
912 </script >
1013
1114<template >
@@ -27,9 +30,9 @@ defineExpose(expose);
2730 </div >
2831 </div >
2932
30- <hr v-if =" value.details.length " class =" my-4 border-gray-300 dark:border-gray-700" />
33+ <hr v-if =" hasDetails " class =" my-4 border-gray-300 dark:border-gray-700" />
3134
32- <div v-if =" value.details.length " >
35+ <div v-if =" hasDetails " >
3336 <ul class =" list-none space-y-2" >
3437 <li v-for =" (value, label) in value.details" :key =" label" >
3538 <Description >
Original file line number Diff line number Diff line change 11<script setup>
22import { Fieldtype } from ' @statamic/cms' ;
33import { Heading , Description , Icon } from ' @statamic/cms/ui' ;
4+ import { computed } from ' vue' ;
45
56const emit = defineEmits (Fieldtype .emits );
67const props = defineProps (Fieldtype .props );
78const { expose } = Fieldtype .use (emit, props);
89defineExpose (expose);
10+
11+ const hasDetails = computed (() => Object .entries (props .value .details ).length > 0 );
912 </script >
1013
1114<template >
@@ -32,9 +35,9 @@ defineExpose(expose);
3235 </div >
3336 </div >
3437
35- <hr v-if =" value.details.length " class =" my-4 border-gray-300 dark:border-gray-700" />
38+ <hr v-if =" hasDetails " class =" my-4 border-gray-300 dark:border-gray-700" />
3639
37- <div v-if =" value.details.length " >
40+ <div v-if =" hasDetails " >
3841 <ul class =" list-none space-y-2" >
3942 <li v-for =" (value, label) in value.details" :key =" label" >
4043 <Description >
You can’t perform that action at this time.
0 commit comments