You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The build.vendor entry suggested in original instructions is not needed. It now now causes build warning WARN: vendor has been deprecated due to webpack4 optimization.
See nuxt/nuxt#5544.
Wrap component into <client-only>. Failing to do that causes Uncaught ReferenceError: window is not defined. Make sure your <script> does not import the component or you get the same error.
// File: ~/components/Autocomplete.vue<template><div><client-onlyplaceholder="Loading..."><vue-tags-inputv-model="tag"
:tags="tags"
:autocomplete-items="filteredItems"
@tags-changed="newTags => tags = newTags"/></client-only></div></template><script>// Do NOT use the import below. It is not needed.// import VueTagsInput from '@johmun/vue-tags-input';exportdefault{data(){return{tag: '',tags: [],autocompleteItems: [{text: 'Spain',},{text: 'France',},{text: 'USA',},{text: 'Germany',},{text: 'China',}],};},computed: {filteredItems(){returnthis.autocompleteItems.filter(i=>{returni.text.toLowerCase().indexOf(this.tag.toLowerCase())!==-1;});},},};</script>
The text was updated successfully, but these errors were encountered:
If you are just using the script on one component/page, why the hassle with the plugin method? Just import the script in the page. Is there a reason for the global plugin?
The Nuxt usage instructions are outdated and cause errors and warning.
This has been tested with
Nuxt 2.15.8
andVue 2.6.14
yarn add @johmun/vue-tags-input
nuxt.config.js
to register the plugin and use it in client-side rendering.The
build.vendor
entry suggested in original instructions is not needed. It now now causes build warningWARN: vendor has been deprecated due to webpack4 optimization.
See nuxt/nuxt#5544.
<client-only>
. Failing to do that causesUncaught ReferenceError: window is not defined
. Make sure your<script>
does not import the component or you get the same error.The text was updated successfully, but these errors were encountered: