Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dropdown returns the entire tag object --need to show only tag content #129

Open
campgurus opened this issue May 29, 2020 · 2 comments
Open

Comments

@campgurus
Copy link

I am using this package with a tag input, pulling the list of tags from an external api and everything is working well, except this issue.

I can't figure out how to use the array of tag objects with { :id, :tag } but in the drop down show only the :tag.

here is the component:


              <vue-tags-input
                v-model="tag"
                v-on:keyup.native="getTags"
                :tags="tags"
                :autocomplete-items="filteredItems"
                :autocomplete-min-length=3
                @tags-changed="confirmedTags"
              />

and filteredItems returns an array of Tag objects.

@campgurus
Copy link
Author

campgurus commented May 29, 2020

This is what the current drop down looks like:
Screen Shot 2020-05-29 at 3 35 03 PM

@ryansorensen
Copy link

@campgurus you either have to override the template

      <template #tag-left="{tag}">
        <div v-if="tag.tagScope">
          {{ tag.tagScope.tagScopeName }}
        </div>
      </template>

or create a computed property / function that maps the text you want to display to the "text" property

 return tags.map(t => {
        t.text = t.tagName;
}};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants