question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Attributes are ignored because the component is a fragment instance

See original GitHub issue

Hi there, in my vuex / vue-router spa on a fresh install with just the basic example i’m getting:

vue.common.js?e881:1014 [Vue warn]: Attributes ":selected.sync", ":options" are ignored on component <multiselect> because the component is a fragment instance: http://vuejs.org/guide/components.html#Fragment-Instance

Would really like to use it in my project any insight on this?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:12 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
shentaocommented, Jul 9, 2016

I’m not sure that the above construction is actually valid. Because you try to register another component named 'multiselect' with Multiselect as a child component, but without providing any template, that would actually start the vue-multiselect inside.

If you need to register the multiselect component globally please do it as in the Vue docs.

import { Multiselect } from 'vue-multiselect'
Vue.component('multiselect', Multiselect)

If you intend on wrapping vue-multiselect inside another component, please try the following code:

import { Multiselect } from 'vue-multiselect'

var CustomSelect = Vue.extend({
    components: { Multiselect },
    template: '<div><multiselect :selected="selected" :options="options"></multiselect></div>',
    data: function() {
        return {
            selected: null,
            options: ['list', 'of', 'options']  
        };
    }
})

Vue.component('customselect', CustomSelect);

You could try omiting the additionall <div> inside the template string. Then you could run the component with <customselect></customselect>.

Let me know if this helps! 😃

1reaction
shentaocommented, Jun 17, 2016

How do you import the component?

It should be like this: import { Multiselect } from 'vue-multiselect' See the documentation for further examples.

If you omit the { } it will throw the above error. Let me know if this helps. I hope it does! 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Vue - Attributes are ignored on component because the ...
I have a component where I am using a child component . ... Vue - Attributes are ignored on component because the component...
Read more >
Vue.js component is a fragment instance - Stack Overflow
1 Answer 1 · Sorry should have mentioned that. · Try this to ensure it is even the area you think it is......
Read more >
Solve component is a fragment instance issue - Medium
Attribute “v-cloak” is ignored on component <component-name> because the component is a fragment instance. Just go to your component ...
Read more >
Rennetti.com
Solving VuejS Attribute xxxx is ignored on component router-view because the component is a fragment instance. Posted 6 years ago - updated 6...
Read more >
Components - API Manual
To use this constructor as a component, you need to register it with ... the component can now be used in a parent...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found