mirror of
https://github.com/nuxt/nuxt.git
synced 2024-12-04 19:37:18 +00:00
feat(nuxt): support vue directive auto-imports within unimport (#29818)
This commit is contained in:
parent
a01c41b4d3
commit
474832f653
@ -41,13 +41,19 @@ export default defineNuxtModule<Partial<ImportsOptions>>({
|
||||
// Filter disabled sources
|
||||
// options.sources = options.sources.filter(source => source.disabled !== true)
|
||||
|
||||
const { addons: inlineAddons, ...rest } = options
|
||||
|
||||
const [addons, addonsOptions] = Array.isArray(inlineAddons) ? [inlineAddons] : [[], inlineAddons]
|
||||
|
||||
// Create a context to share state between module internals
|
||||
const ctx = createUnimport({
|
||||
injectAtEnd: true,
|
||||
...options,
|
||||
...rest,
|
||||
addons: {
|
||||
addons,
|
||||
vueTemplate: options.autoImport,
|
||||
...options.addons,
|
||||
vueDirectives: options.autoImport === false ? undefined : true,
|
||||
...addonsOptions,
|
||||
},
|
||||
presets,
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user