From ad0472d7aec97b9cd791af5d4adeee1d92f83207 Mon Sep 17 00:00:00 2001 From: Erwan Rouchet <rouchet@teklia.com> Date: Thu, 14 Dec 2023 10:29:30 +0100 Subject: [PATCH] Fix TypeScript errors when using the truncateMixin --- src/mixins.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/mixins.js b/src/mixins.js index c07c823bd..4b76f5a38 100644 --- a/src/mixins.js +++ b/src/mixins.js @@ -1,3 +1,4 @@ +import { defineComponent } from 'vue' import { TRUNCATE_LENGTHS } from './config' import { ensureArray } from './helpers' @@ -6,7 +7,7 @@ const truncateFilter = maxLength => text => { return text ?? '' } -export const truncateMixin = { +export const truncateMixin = defineComponent({ methods: { truncateSelect: truncateFilter(TRUNCATE_LENGTHS.select), truncateLong: truncateFilter(TRUNCATE_LENGTHS.long), @@ -14,7 +15,7 @@ export const truncateMixin = { truncateNotification: truncateFilter(TRUNCATE_LENGTHS.notification), truncateId: truncateFilter(TRUNCATE_LENGTHS.id) } -} +}) const corporaFilters = { // From a corpus, returns true if the corpus is readable. -- GitLab