vue-initials-img icon indicating copy to clipboard operation
vue-initials-img copied to clipboard

Consider middle name

Open riker09 opened this issue 7 years ago • 1 comments

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. 😉

riker09 avatar Jul 24 '17 05:07 riker09

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

NxtChg avatar Jul 27 '17 21:07 NxtChg