Questions tagged [vuejs3-composition-api]
The vuejs3-composition-api tag has no usage guidance.
vuejs3-composition-api
34
questions
0
votes
0
answers
14
views
Update data after query fetching on success with vue query v5
I am using @tanstack/vue-query package, and I am not sure how to update data after the query fetching is completed successfully.
I can write data update logic in query function but I want to extract ...
1
vote
1
answer
47
views
Keep passed slots to a slotted component via a functional wrapper
Playground
I have the following:
<script setup>
import { ref } from 'vue'
import Input from './Input.js'
import Text from './Text.vue'
const msg = ref('Hello World!')
</script>
<...
0
votes
1
answer
50
views
Question about vue 3 lifecycle and availability of properties
I want to load some content of a vue component based on a given argument. Here is some code to illustrate:
ParentComponent.vue
<Suspense>
<div class="row g-0">
<div class=&...
0
votes
0
answers
36
views
Arrays in pinia seem to be not reactive
I have problems in pinia with reactivity of an array of objects which have an array of objects themselves.
In pinia I have an array of voyage-objects. A voyage has an array of leg-objects.
If I add a ...
1
vote
1
answer
32
views
Use of Vue component leads to typescript error ts2749 in template
I want to build an example on the Vue Playground.
I created the following 4 files:
<!-- App.vue -->
<script setup lang="ts">
import LegList from './LegList.vue';
</script>
...
0
votes
2
answers
89
views
PrimeVue Datatable change paginator icons
I have a PrimeVue datatable in my Vue 3 composition API app. I am using unstyled mode and the Lara preset.
I have set paginator to true and it works fine. However, I want to use different icons for ...
0
votes
1
answer
33
views
Button text won't update to 'Finish' when i get to the last question for my VUE 3 quiz app
Building a quiz app in vue 3 and everything works as its suppose to til i get to the last question, where the button text is suppose to say 'Finish' as soon as the question is loaded. new to vue and ...
0
votes
1
answer
312
views
Getting intellisense errors when declaring or using TS types/interfaces in Vue.js SFC files
I'm developing a component for my Nuxt 3 project. I'm trying to declare an interface to provide strong typings for the component props, e.g.:
<script setup>
interface Props {
float: number;
}
...
1
vote
1
answer
187
views
VueUse onClickOutside does not work with right click
I am currently trying to use onClickOutside but it only works when i click outside with the left mouse button.
I need to get this working for the right mouse button too.
Any solution for this? Maybe i ...
0
votes
1
answer
802
views
How to extend/use mixin in Vue 3 composition API with script setup
I am using Composition API with <script setup> in one component (ComponentA.vue) and want to extend a mixin (Greeting.ts) inside Component A.
Problem statement : When I am trying to access ...
0
votes
0
answers
278
views
How can I access context's req in Nuxt3?
How can I access context's req in Nuxt3?
nuxt2
asyncData({req}) {
const body = req.body;
}
I used useRequestEvent().req.body and useNuxtApp().event.req.body.
but both is undefined.
nuxt3
const event =...
0
votes
1
answer
467
views
How get route's params with Nuxt3
I used Nuxt3 with Composition API.
When moving from bakset to order, basket is using router.push, and is turning over parameters. How can I get these parameters from order? In the nuxt2 version, you ...
0
votes
0
answers
49
views
How to create a vuejs3 or nuxt3 component from data loaded from an API
I'm creating a SPA on Nuxt 3 (ssr: false) that loads data from a Drupal site.
Each "page" of my SPA corresponds to a Drupal page loaded via Drupal JSON API and I can use the v-html directive ...
0
votes
0
answers
178
views
How to Test route from useRoute in a Vue.js 3 Composition API Component?
I'm facing challenges in testing a Vue.js 3 component that utilizes the useRoute from the Vue Router within the Vue Test Utils, Mocha, and Chai framework. My component is written using the Composition ...
1
vote
1
answer
75
views
Manually changing route in vue js 3 is causing problem
I have created vue js application. I don't have my own domain. I have hosted my code on two websites vercel.com and netlify.com. My code is working fine. But when I change any route by writing url ...