31 lines
716 B
Vue
31 lines
716 B
Vue
<script setup lang="ts">
|
|||
|
|
import { computed } from 'vue'
|
||
|
|
|
||
|
|
const props = withDefaults(defineProps<{
|
||
|
|
value?: string | null
|
||
|
|
emptyText?: string
|
||
|
|
}>(), { value: null, emptyText: '—' })
|
||
|
|
|
||
|
|
const displayValue = computed(() => {
|
||
|
|
const value = String(props.value ?? '')
|
||
|
|
return value || props.emptyText
|
||
|
|
})
|
||
|
|
|
||
|
|
const fullTitle = computed(() => displayValue.value === props.emptyText ? undefined : displayValue.value)
|
||
|
|
</script>
|
||
|
|
|
||
|
|
<template>
|
||
|
|
<span class="order-reference-text" :title="fullTitle">{{ displayValue }}</span>
|
||
|
|
</template>
|
||
|
|
|
||
|
|
<style scoped>
|
||
|
|
.order-reference-text {
|
||
|
|
display: inline-block;
|
||
|
|
max-width: 100%;
|
||
|
|
overflow: hidden;
|
||
|
|
text-overflow: ellipsis;
|
||
|
|
vertical-align: bottom;
|
||
|
|
white-space: nowrap;
|
||
|
|
}
|
||
|
|
</style>
|