GRV
GRV

Reputation: 43

how to work with vue plugin in nuxt project

I want to use tailwind typeahead vue plugin in nuxt. i have added the package using npm install vue-tailwindcss-typeahead .

then i created a file in plugins folder. tailwind-typeahead.js with following code

import Vue from 'vue'
import VueTailwindcssTypeahead from 'vue-tailwindcsscss-typeahead'

Vue.use(VueTailwindcssTypeahead)

and included the plugin file in nuxt.config.js

{ src: './plugins/tailwind-typeahead.js' }

But i am getting this error

   This dependency was not found:                                                                                   friendly-errors 01:44:37
                                                                                                                 friendly-errors 01:44:37
* vue-tailwindcsscss-typeahead in ./plugins/tailwind-typeahead.js                                              friendly-errors 01:44:37
                                                                                                                 friendly-errors 01:44:37
To install it, you can run: npm install --save vue-tailwindcsscss-typeahead 

for reference here is the link of package

https://github.com/basarozcan/vue-tailwindcss-typeahead

Upvotes: 2

Views: 610

Answers (1)

kissu
kissu

Reputation: 46814

You do have a typo in your plugin: vue-tailwindcsscss-typeahead.

You probably meant to write vue-tailwindcss-typeahead .

The rest is fine and it's the way to go if you want your code to be globally available in your Nuxt app. If you only want it local, import it in the component itself.

Upvotes: 3

Related Questions