eliep / vue-avatar

An avatar component for vue.js

Home Page:https://eliep.github.io/vue-avatar

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Attribute "username" is ignored on component <avatar> because the component is a fragment instance

lukpep opened this issue · comments

vue.js version 1.0.24

JS:
import Avatar from 'vue-avatar'

components: {
      Avatar
    },

html:
<avatar username="Jane Doe"></avatar>

commented

Hi lukpep,

I'm not sure the component is a fragment instance, because it has a single root-level element.

In your case, the import might be the problem. Can you try

import Avatar from 'vue-avatar/dist/Avatar'

components: {
  Avatar
},

or

import Avatar from 'vue-avatar'

components: {
  'avatar': Avatar.Avatar
},
components: {
  'avatar': Avatar.Avatar
},

works fine. Thanks for Your help :)