From f27dca504b819021a19ee0dae83c20e77bc43566 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=A4fer?= Date: Mon, 6 May 2019 22:59:25 +0200 Subject: [PATCH] Refactor mixin with computed property @ulfgebhardt I refactored the mixin because it's not enough code to justify the additional complexity. If it's just two lines of code, I find it the best solution to use a computed property. You can use components and computed properties excessively, they tend to be easier to maintain in the long run. --- webapp/components/User/index.vue | 10 ++++++---- webapp/layouts/default.vue | 9 ++++++--- webapp/mixins/userName.js | 8 -------- webapp/pages/profile/_id/_slug.vue | 18 ++++++++++-------- 4 files changed, 22 insertions(+), 23 deletions(-) delete mode 100644 webapp/mixins/userName.js diff --git a/webapp/components/User/index.vue b/webapp/components/User/index.vue index 4b9b5c8e8..857f4f302 100644 --- a/webapp/components/User/index.vue +++ b/webapp/components/User/index.vue @@ -38,7 +38,7 @@ > @@ -47,7 +47,7 @@ {{ userName(user.name) | truncate(18) }} + >{{ userName | truncate(18) }}
{{ $t('login.hello') }} - {{ userName(user.name) }} + {{ userName }}