mirror of
https://github.com/crater-invoice/crater.git
synced 2025-10-27 11:41:09 -04:00
32 lines
497 B
Vue
32 lines
497 B
Vue
<template>
|
|
<BaseCustomTag :tag="tag" :title="text">
|
|
{{ displayText }}
|
|
</BaseCustomTag>
|
|
</template>
|
|
|
|
<script setup>
|
|
import { computed } from "vue"
|
|
|
|
const props = defineProps({
|
|
tag: {
|
|
type: String,
|
|
default: 'div',
|
|
},
|
|
|
|
text: {
|
|
type: String,
|
|
default: '',
|
|
},
|
|
|
|
length: {
|
|
type: Number,
|
|
default: 0,
|
|
}
|
|
})
|
|
|
|
const displayText = computed(() => {
|
|
|
|
return props.text.length < props.length ? props.text : `${props.text.substring(0 , props.length)}...`
|
|
})
|
|
</script>
|