scinote-web/app/javascript/vue/shared/string_with_ellipsis.vue
2024-02-23 14:16:03 +01:00

26 lines
447 B
Vue

<template>
<div :title="text" class="flex items-center">
<div class="truncate">
{{ text.slice(0, endCharacters * -1) }}
</div>
<div class="shrink-0">
{{ text.slice(text.length - endCharacters) }}
</div>
</div>
</template>
<script>
export default {
name: 'StringWithEllipsis',
props: {
text: {
type: String,
required: true
},
endCharacters: {
type: Number,
default: 4
}
}
};
</script>