NuxtN
Nuxt2y ago
maroo

How can I use defineModel in modules?

I am writing a module that supplies a number of components to help with input and output.
I want to simplify the implementation by using defineModel, but it doesn't work as expected.
I can avoid the error by specifying nuxt.options.vite.vue.script['defineModel'] = true in the module's setup().
But substituting a .value does not change the value

const open = defineModel<boolean>({
  required: false,
  default: false,
})
// ...
open.value = true // does not effect


Where should I refer to change the vite option when compiling a module?
Was this page helpful?