#How to add a Vue3 plugin?

3 messages · Page 1 of 1 (latest)

velvet laurel
#

Hello, i'm new to nuxt 3 and i want to install a simple color picker plugin (https://github.com/anish2690/vue-color-kit) but it seems I'm not doing it right.
I did create a plugin file which contains

import { ColorPicker } from 'vue-color-kit'
import 'vue-color-kit/dist/vue-color-kit.css'

export default defineNuxtPlugin((nuxtApp) => {
  nuxtApp.vueApp.use(ColorPicker)
})

and not only ColorPicker in nuxtApp.vueApp.use(ColorPicker) is underlined red (it seems that the error message is because ColorPicker is a type of "DefineComponent"

and when i register my component in my page i get [Vue warn]: Failed to resolve component: ColorPicker
I guess the solution must be simple, but I didn't find anything very understandable while searching.

Thank you in advance!

GitHub

🎨 Lightweight color picker for Vue 3. Contribute to anish2690/vue-color-kit development by creating an account on GitHub.

pallid laurel
#

@velvet laurel