Skip to content

Commit dc169c6

Browse files
committed
Fix payment & shipping details not showing
1 parent d16d391 commit dc169c6

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

resources/js/components/fieldtypes/PaymentDetailsFieldtype.vue

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
<script setup>
22
import { Fieldtype } from '@statamic/cms';
33
import { Heading, Description, Icon } from '@statamic/cms/ui';
4+
import { computed } from 'vue';
45
56
const emit = defineEmits(Fieldtype.emits);
67
const props = defineProps(Fieldtype.props);
78
const { expose } = Fieldtype.use(emit, props);
89
defineExpose(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>

resources/js/components/fieldtypes/ShippingDetailsFieldtype.vue

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
<script setup>
22
import { Fieldtype } from '@statamic/cms';
33
import { Heading, Description, Icon } from '@statamic/cms/ui';
4+
import { computed } from 'vue';
45
56
const emit = defineEmits(Fieldtype.emits);
67
const props = defineProps(Fieldtype.props);
78
const { expose } = Fieldtype.use(emit, props);
89
defineExpose(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>

0 commit comments

Comments
 (0)