From 3ce7f69a9dfe51bc88cce324341689a271cf5d50 Mon Sep 17 00:00:00 2001 From: RustyRaptor Date: Sun, 14 Apr 2024 10:32:03 -0600 Subject: [PATCH] Explain the default behavior of primevue.components.exclude in the Nuxt module configuration and how to mitigate. In the documentation for configuring the Nuxt module components, there is no indication that Chart and Editor are excluded by default. The only way to find out is if you happen upon a single issue in the github repo of the nuxt module npm package or read the full source code of the module. Although the intention of this default behavior is to avoid compatibility issues because of the dependencies of those 2 components, it leads to even more confusion when you know what they need but they aren't being detected as components. They are excluded even if you use the * option in include. This change introduces a helpful tip into the docs page so users know what to do when they want to use those components. --- doc/nuxt/configuration/ComponentsDoc.vue | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/doc/nuxt/configuration/ComponentsDoc.vue b/doc/nuxt/configuration/ComponentsDoc.vue index 890c9f13d..d6001da4b 100644 --- a/doc/nuxt/configuration/ComponentsDoc.vue +++ b/doc/nuxt/configuration/ComponentsDoc.vue @@ -4,13 +4,15 @@

In case all components are imported, particular components can still be excluded with the exclude option.

-

Use the prefix option to give a prefix to the registered component names.

+

By default, for compatibility reasons, Chart and Editor components are excluded. To include them simply set the exclude option to an empty list.

+

Use the prefix option to give a prefix to the registered component names.

+

Component registration can be customized further by implementing the name function that gets an object representing the import metadata. name is the label of the component, as is the default export name and from is the import path.

- + @@ -39,6 +41,15 @@ primevue: { }, code3: { basic: ` +primevue: { + components: { + exclude: [] + } +} +` + }, + code4: { + basic: ` primevue: { components: { prefix: 'Prime' @@ -47,7 +58,7 @@ primevue: { } ` }, - code4: { + code5: { basic: ` primevue: { components: {