export default { name: 'avatar', props: { src: { default: 'https://avatars.githubusercontent.com/u/0?v=3', type: String, }, size: { default: 20, type: Number, }, }, computed: { style() { return `width: ${this.size}px; height: ${this.size}px;`; }, sizedSrc() { return `${this.src}&s=${this.size * 2}`; }, }, }; </script> <style lang="stylus" scoped> .avatar border-radius 50% overflow hidden margin-right 9px </style>