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.

Multiselect is always fragment instance

See original GitHub issue

@shentao

Hello, I have the same problem and I’ve tried everything suggested in issue #34 and #36, still no solution. I tried registering multiselect as global component, used it as a child component to my custom component, tried to use it in .vue component file, tried to use it in custom component markup (using inline-template directive). Tried it with both of these combinations for importing: import { Multiselect } from 'vue-multiselect' and import Multiselect from 'vue-multiselect'

This is my custom <tag-popover component (exported in tag-popover.vue file). This is the template part:

<template>
  <div>
    <p v-if="timelog.tags.length < 1" class="tags"><a @click.prevent="openPopup" href="#">Add tags...</a></p>
      <div v-else class="tags" id="timelog-tags-@{{ timelog.id }}" v-on:click="openPopup">
        <template v-for="tag in timelog.tags | limitBy 2">
          <span class="label label-primary">@{{ tag.name }}</span>
        </template>
      </div>

    <div v-show="showPopup" id="inner-tags-popup-@{{ timelog.id }}" class="entry">
      <h1>Popover works</h1>
      <div>
        <multiselect @tag="addTag" @select="selectTag" @remove="removeTag"
                     :close-on-select="false" :taggable="true"
                     :multiple="true" label="name" key="id"
                     :selected="timelog.tags" :options="tags">
        </multiselect>
      </div>
    </div>
  </div>
</template>

This is the script part:

import PopoverMixin from './popover-mixin'
import { Multiselect } from 'vue-multiselect'

export default {
  props: ['tags', 'timelog', 'showPopup'],
  mixins: [PopoverMixin],
  components: {
    Multiselect
  },
  methods: {
    // ...some methods
  }
}

This is the console error I’m getting [Vue warn]: Attributes ":close-on-select", ":taggable", ":multiple", "label", "key", ":selected", ":options" are ignored on component <multiselect> because the component is a fragment instance: http://vuejs.org/guide/components.html#Fragment-Instance.

Here is apps hierarchy in Vue Devtools: image

One more thing, project is based on Laravel Spark.

I’m really stuck with this and I would like to use vue-multiselect cause it’s awesome.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:2
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
travisamillercommented, Aug 30, 2016

@IvanBernatovic I am also using Laravel Spark + Elixir + Vueify and found the following to work (using <multi-select> as the tag):

<script>
    import { Multiselect } from 'vue-multiselect'
    export default {
        props: [],
        components: {
            'multi-select': Multiselect
        },
        methods: {
        }
    }
</script>

This seems to work as well:

<script>
    export default {
        props: [],
        components: {
            'multi-select': require('vue-multiselect').Multiselect
        },
        methods: {
        }
    }
</script>
1reaction
shentaocommented, Aug 31, 2016

Glad it finally works. Sorry, I couldn’t help you. @yyx990803 maybe you could provide some insight here? I know there is just a notice which says:

Note that Vue.js does not enforce the W3C rules for custom tag-names (all-lowercase, must contain a hyphen) though following this convention is considered good practice.

Read more comments on GitHub >

github_iconTop Results From Across the Web

MultiSelect - Mantine
MultiSelect support two different data formats: An array of strings – use when you do not need to customize item component or display...
Read more >
selected value missing from from the multi select column in the ...
I am using the the following code for the multiselection of all department. But when I call the function FillEmployee() , all the...
Read more >
Get the Values of a Multi-Select Field - Adaptavist Library
Use this script to retrieve the selected values of a multi-select field and perform actions based on them. Example. As a support engineer,...
Read more >
Select multiple items in ListFragment - android - Stack Overflow
1 Answer 1 ... How do you set the ListView in a ListFragment to multiple choice? getListView().setChoiceMode(ListView.CHOICE_MODE_MULTIPLE) from ...
Read more >
Selection and Range - The Modern JavaScript Tutorial
It's only important that the end is after the start in the document. Selecting a bigger fragment. Let's make a bigger selection in...
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