maroo
maroo
NNuxt
Created by maroo on 9/11/2024 in #❓・help
Is it safe to use useFetch() inside a function?
Is it unsafe to use useFetch() inside a function? After making a POST request, the request repeats every time the reactive variable ref() is changed within the page. Could this be a bug? Please refer to the minimal example: https://codesandbox.io/p/devbox/h4cqq2?file=%2Fapp.vue%3A28%2C9
6 replies
NNuxt
Created by maroo on 6/13/2024 in #❓・help
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
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?
1 replies
NNuxt
Created by maroo on 6/4/2024 in #❓・help
Big cache file for yaml in nuxt/content module
When I tried to serve hundreds of yaml files in a static build using nuxt content, I found that it created a very big .output/public/cache.XXXXX.json file. Unlike a markdown file, where only the frontmatter is indexed, having all fields cached and growing to several megabytes is not the desired effect. Is there any way to prevent certain fields from being cached? BTW, the tag has no content.
1 replies