26 lines
575 B
Vue
26 lines
575 B
Vue
<script setup>
|
|
const props = defineProps({
|
|
row: {
|
|
type: Object,
|
|
required: true,
|
|
default: {}
|
|
}
|
|
})
|
|
|
|
const descriptionText = computed(() => {
|
|
const description = props.row?.description
|
|
if (!description) return ""
|
|
if (typeof description === "string") return description
|
|
if (typeof description === "object") {
|
|
if (typeof description.text === "string" && description.text.trim().length) {
|
|
return description.text
|
|
}
|
|
}
|
|
return String(description)
|
|
})
|
|
</script>
|
|
|
|
<template>
|
|
<div v-if="descriptionText">{{ descriptionText }}</div>
|
|
</template>
|