mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-11-20 19:02:27 -05:00
nuxt init
This commit is contained in:
18
frontend.old/src/mixins/initials.js
Normal file
18
frontend.old/src/mixins/initials.js
Normal file
@@ -0,0 +1,18 @@
|
||||
export const initials = {
|
||||
computed: {
|
||||
initials() {
|
||||
if (!this.user.fullName) return "00"
|
||||
const allNames = this.user.fullName.trim().split(" ");
|
||||
const initials = allNames.reduce(
|
||||
(acc, curr, index) => {
|
||||
if (index === 0 || index === allNames.length - 1) {
|
||||
acc = `${acc}${curr.charAt(0).toUpperCase()}`;
|
||||
}
|
||||
return acc;
|
||||
},
|
||||
[""]
|
||||
);
|
||||
return initials;
|
||||
},
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user