Closed enkot closed 4 months ago
@Tahul @BobbieGoede Can we merge it soon? This is a fairly simple fix
Good find, thanks!
I think this change fixes/allows users to also provide/exclude directives with the motion
key in nuxt.config.ts
, options provided through runtimeConfig.public.motion
should have been working as expected https://github.com/vueuse/motion/blob/main/src/nuxt/runtime/templates/motion.ts#L8 without this change.
@BobbieGoede I think it makes sense to show the example with motion
key and not runtimeConfig in the Installation section of the docs, WDYT?
// nuxt.config.ts
export default defineNuxtConfig({
motion: {
directives: {
'pop-bottom': {
initial: {
scale: 0,
opacity: 0,
y: 100,
},
visible: {
scale: 1,
opacity: 1,
y: 0,
}
}
}
}
})
Typically, runtimeConfig is an alternative, but not the primary option.
I agree, runtimeConfig is nice but secondary to configuration by key and modules array, we should update the docs.
We should probably consider deprecating runtimeConfig for the next major version and instead support and recommend configuring directives/presets in app.config
since changes will update reactively without restarting the Nuxt server.
๐ Linked issue
โ Type of change
๐ Description
Hi ๐ Currently module options are not public, so
config.public.motion
is always undefined in the Vue plugin. This PR makes options public.๐ Checklist