vue-initials-img
vue-initials-img copied to clipboard
Consider middle name
Hi, nice component. I had worked up something very similar but never had the time to make a full fledged single component out of it. I really like your approach with the different colors, haven't thought of it myself. 😄
Anyway, there's always room for improvement, and I noticed that you split the user name by (white)space. When there's more than one array element you always take the second part and leave out the rest. Wouldn't it be more useful to take the first and the last element? I'm thinking Array.shift() and Array.pop() here. This way Tom Marvolo Riddle is not rendered as TM but TR. Just my two cents. 😉
Fixed that and also added 'shape' prop and round background.
https://github.com/NxtChg/vuepack/blob/master/components/vue-initials-img.js
Minor note:
this: <vue-initials-img :name="Frank Underwood"/>
should be: <vue-initials-img name="Frank Underwood"></vue-initials-img>
Also added it to http://vuepack.org