Skip to content

Commit

Permalink
show label in detail field
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastian Hilger committed Dec 5, 2019
1 parent 72576f5 commit 4b586d6
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 13 deletions.
2 changes: 1 addition & 1 deletion dist/js/field.js

Large diffs are not rendered by default.

46 changes: 34 additions & 12 deletions resources/js/components/DetailField.vue
Original file line number Diff line number Diff line change
@@ -1,26 +1,48 @@
<template>
<div class="tiptap-detail-field py-4">
<truncate
clamp="Show More"
:length="200"
less="Show Less"
type="html"
:text="field.value"
>

</truncate>
<div class="flex">
<div class="w-1/4 py-4">
<h4 class="font-normal text-80">
{{ label }}
</h4>
</div>

<div class="tiptap-detail-field w-3/4 py-4">
<truncate
clamp="Show More"
:length="200"
less="Show Less"
type="html"
:text="field.value"
>

</truncate>
</div>
</div>
</template>

<script>
import truncate from 'vue-truncate-collapsed'
export default {
props: ['resource', 'resourceName', 'resourceId', 'field'],
components: {
truncate,
},
props: {
field: {
type: Object,
required: true,
},
fieldName: {
type: String,
default: '',
},
},
computed: {
label() {
return this.fieldName || this.field.name
},
},
}
</script>

Expand Down

0 comments on commit 4b586d6

Please sign in to comment.