All Questions
Tagged with vue-composition-api nuxt.js
106 questions
0
votes
0
answers
62
views
Difference between nuxtApp.provide and vueApp.provide
In nuxt 3 you have two alternative ways to provide something globally
// using nuxtApp instance
useNuxtApp().provide('key', 'value')
console.log(nuxtApp.$key) // value
// using vueApp instance
...
1
vote
1
answer
78
views
Computed property lack of reactivity for deep nested object
EDIT01: I'm using "nuxt": "^2.16.0" with "@nuxtjs/composition-api": "^0.29.2".
I'm have been trying for days to figure this out but still dealing with this ...
0
votes
1
answer
167
views
Nuxt app, page doesn't load data when navigating, but does when refreshing page
I'm using some third party api's and try to display data on a page. I use Nuxt (3.13) for this.
Nuxt documentation seems quite straighforward, but I can not get this to work properly.
I'm using ...
1
vote
0
answers
75
views
How to stop executing rest of code in script setup syntax in composition api Vue 3
I have a page template that contains the following sub-component:
<template>
<ManageVacanciesAndMatchesTabVacancies @loading-data="setIsTabDataLoading" />
</template>
And ...
2
votes
0
answers
557
views
Multiple uses of useFetch is causing [nuxt] A composable that requires access to the Nuxt instance was called outside of a plugin, Nuxt hook,etc
I am writing my Nuxt3 components in the non-composable way and I am not willing to refactor them. I am using useFetch instead of $fetch to avoid double requests in client and server side.. By using ....
1
vote
0
answers
55
views
calling a modular window component through another file
Guys please tell me how I can implement the modal window approach.
Let's say I have in the main component: <button @click="Modal">open</button>.
I want it to open and close. i.e....
0
votes
0
answers
561
views
Vue Unhead generates warnining "[Vue warn]: inject() can only be used inside setup() or functional components. "
I'm trying to use the Unhead library in a Vue 3 project, it works fine however I keep getting this Vue warning originating from a view component
[Vue warn]: inject() can only be used inside setup() ...
2
votes
1
answer
2k
views
how to set route query as useAsyncData watch property
I want the useAsyncData to restart when the route query changes
I tried this in my script setup
const route = useRoute()
await useAsyncData(
'products',
() => {
// some code
},
{
...
3
votes
0
answers
119
views
pinia composition api 'this' type problem
I am using Nuxt 2 with Pinia Composition API. Through a plugin, I have added axios instances, etc., into PiniaCustomProperties.
const piniaPlugin = ({ $pinia, app }: { $pinia: any; app: any }): void =&...
1
vote
1
answer
2k
views
(Vue 3, Nuxt 3) The value from the child component to parent component emits only after adding changes in vs code
I need to emit the height value from the СhildСomponent into the pages/index component in the puzzleSelectBlockHeight ref. But the problem is that this only happens after I change something in the ...
0
votes
0
answers
104
views
Pinia type inference broken when my computed properties are in the code, when I remove them, type inference works again
If I remove all of the computed(()=>{}) definitions, i get back type inference. When I put them back, the store reverts back to type any. I loose all ts help in other files.
I tried removing the ...
1
vote
0
answers
462
views
Use vuex (v3) together with composition-api in nuxt-bridge
I have upgraded a nuxt 2 project to nuxt-bridge and I have to rewrite some components.
I want to use the (core) vue composition api and my old vuex store.
I've had things like: import { mapActions, ...
0
votes
0
answers
164
views
I would like to use a library in my NUXT application, but it is giving me error that Top-level await is not available in the configured target env
I am importing a npm library inside my component and inside
error in that npm library:
Top-level await is not available in the configured target environment ("chrome87", "edge88", ...
1
vote
0
answers
564
views
Upgrade to nuxt-bridge: Auto-imports cause eslint errors
I want to upgrade a nuxt v2.16 project to v2.17 and nuxt-bridge and replace the @nuxt/composition-api with the core composition api.
Now I have autoimports and this code for example runs:
// ...
...
1
vote
1
answer
2k
views
How to detect route direction (back or forward) while changing routes in NuxtJS?
I am trying to make users close the menu instead of going to the previous route when they press the back button on their phone in my Nuxt app.
<script setup>
function closeMenuOnRouteBack() {
...