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

how to import/use external component libraries? and how to register components? #7

Open
capoia opened this issue Aug 9, 2023 · 3 comments

Comments

@capoia
Copy link

capoia commented Aug 9, 2023

Hello, I would like to know how to import a library that will be used throughout the project (options / popup / content / CSUI...)
example: https://primevue.org/installation/

And another doubt would be how do I import previously created components (.vue), mainly within the CSUI.

@jfl913
Copy link

jfl913 commented Aug 10, 2023

Here is a reference for you

import "vuetify/lib/styles/main.css"
import { createVuetify } from 'vuetify'
import * as components from 'vuetify/lib/components/index.mjs'
import * as directives from 'vuetify/lib/directives/index.mjs'
defineOptions({
    prepare(app: App) {
        // Use any plugins here:
        // app.use
        const vuetify = createVuetify({
            components,
            directives,
        })
        app.use(vuetify)
    }
})

@capoia
Copy link
Author

capoia commented Aug 12, 2023

Here is a reference for you

import "vuetify/lib/styles/main.css"
import { createVuetify } from 'vuetify'
import * as components from 'vuetify/lib/components/index.mjs'
import * as directives from 'vuetify/lib/directives/index.mjs'
defineOptions({
    prepare(app: App) {
        // Use any plugins here:
        // app.use
        const vuetify = createVuetify({
            components,
            directives,
        })
        app.use(vuetify)
    }
})

@jfl913 Thank you very much for your help, but I still have one doubt:

  • Do I need to import/define the package in each place I want to use it?
    once in popup.vue, once in options.vue...

I managed to make it work on the popup, but not on the contents

@jfl913
Copy link

jfl913 commented Aug 16, 2023

Yes, you need to import/define the package in each place.

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