add nova
This commit is contained in:
35
nova/resources/js/fields/Detail/StackField.vue
Normal file
35
nova/resources/js/fields/Detail/StackField.vue
Normal file
@@ -0,0 +1,35 @@
|
||||
<template>
|
||||
<PanelItem :index="index" :field="field">
|
||||
<template #value>
|
||||
<div
|
||||
v-if="hasValue"
|
||||
:class="`text-${field.textAlign}`"
|
||||
class="leading-normal"
|
||||
>
|
||||
<component
|
||||
v-for="line in field.lines"
|
||||
:key="line.value"
|
||||
:is="`index-${line.component}`"
|
||||
:field="line"
|
||||
:resourceName="resourceName"
|
||||
/>
|
||||
</div>
|
||||
<p v-else>—</p>
|
||||
</template>
|
||||
</PanelItem>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: ['index', 'resource', 'resourceName', 'resourceId', 'field'],
|
||||
|
||||
computed: {
|
||||
/**
|
||||
* Determine if the field has a value other than null.
|
||||
*/
|
||||
hasValue() {
|
||||
return this.field.lines
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
Reference in New Issue
Block a user