-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Nuxt import component: Prefix doesn't work #6051
Comments
Try https://stackblitz.com/edit/github-tvge24-4nqjsd?file=nuxt.config.ts |
Why i'm need to manually import with when I uncomment both are working, but when commented only the primary is working
|
There are two ways to use dynamic components. I prefer the second one. In short, you have to resolve the component first because the component is not resolving it for you. <script setup lang="ts">
import { SomeComponent } from '#components'
const MyButton = resolveComponent('MyButton')
</script>
<template>
<component :is="clickable ? MyButton : 'div'" />
<component :is="SomeComponent" />
</template> But did my first answer helped you? Before we go through all functionality of Vue or Nuxt, while we are here for PrimeVue. |
Indeed, auto-import stopped working properly when upgrading from version v4.0.0-rc3 to v4.0.0. Not only did the prefixes break, but also the styles. |
@Tarabass Yes it works when I do an explicit import but the auto import should work. In any case in 4.0.0-rc.3 it worked without explicit import |
Yes indeed in 4.0.0-rc.3 it worked without problem |
4.0.1 I still have this problem |
@FabienVINCENT, in your case(prefix: 'Prime');
I think you can set
|
@mertsincan |
Why is it working in my stackblitz, primevue 4, or am I missing something? https://stackblitz.com/edit/github-tvge24-4nqjsd?file=nuxt.config.ts |
@Tarabass +1 ;) The logic of auto-import is to be able to use components without manually importing them. In RC and other older versions, nuxt-module added all components(80+) directly and users had to set up treeshaking manually. With the autoImport feature, we automatically register components using the unplugin API. |
So what's the expected behavior? The latest version still not work with |
I have the same problem, autoimport not working with prefix set to "Prime". When i remove the "Prime" from component it work, but not is the best behaviour for the project. Note: this is a type checking problem (in nuxt not generated the entries in nuxt/components.d.ts), in runtime the component is render successfull. The previous image is before to update primevue v4, |
I have the same behaviour @Erdu-EC |
@vincenzomartusciello It's still a problem, even if it works in production. It creates significant inconveniences during development. |
Trying PrimeVue for the first time. Running into the same issue. Bit of a dealbreaker, unfortunately. |
Describe the bug
When you configure the prefix with the nuxt module, the components are not imported
Reproducer
https://stackblitz.com/edit/github-tvge24?file=nuxt.config.ts
PrimeVue version
4.0.0
Vue version
3.x
Language
TypeScript
Build / Runtime
Nuxt
Browser(s)
Arc
Steps to reproduce the behavior
Remove the prefix configuration and the button with label "No prefix" work
Expected behavior
No response
The text was updated successfully, but these errors were encountered: