173 questions
0
votes
0
answers
82
views
How to use VueX 3.6 mapActions in vue 2.7 script setup
we're using VueX 3.6 with Vue 2.7. The project is old We can't go to Vue3. For new components, we're trying to use script/setup for new components. How to use VueX mapper functions in this situation? ...
2
votes
2
answers
63
views
How to pass data to child component using vue 3 h render after data is changed?
I have an issue that needs to be resolved.
a.ts
const open = ref<boolean>(false)
h(RowAction, {
open: open,
onDelete: () => {
Data.remove().then(() => {}).catch(() => {})....
2
votes
0
answers
188
views
Reset Pinia store nuxt3 with vite HMR
I am having issues with my store not resetting properly when locally developing, this is (i suppose) because of Vite HMR in my Nuxt3 application.
My store is defined as so:
import { defineStore, ...
4
votes
1
answer
3k
views
why do I get this error when I try to use multiple defineModels in vue.js?
I am trying to use the v-model directive on two input elements. However, I am getting the following error: duplicate model name "modelValue". Below I show the code that generates this error:
...
0
votes
1
answer
82
views
Vue.js 3 SFC multiple lists
I am creating a vue.js3 SFC application where the list component is used multiple times. The aim is to produse a separate lists of items in each component from SingleList.vue. I wanted to use a v-for='...
1
vote
1
answer
418
views
vue3 script setup not working with revogrid
I have a vue3 app, in which I'd like to keep using the standard composition api style. Unfortunately, RevoGrid doesn't seem to like it. RevoGrid works with an options api style , but the equivalent ...
7
votes
1
answer
13k
views
How to use defineModel (in Vue 3.4) for uses other than inputs
The examples given for defineModel in the Vue docs all relate to uses for data inputs. I was wondering if this construct could also be used elsewhere, thus avoiding the somewhat cumbersome props/emit ...
1
vote
1
answer
72
views
How can I get the argument type of an SFC component's event?
Say I have an SFC component with a save emit:
// ChildComponent.vue
const emit = defineEmits<{
save: [data: { new: Row[]; removed: Row[] }];
}>();
If I want to use the new & removed in a ...
-1
votes
1
answer
216
views
Vue composition typescript access props value in another props validation
i would want to access the props value from another props validator.
Here is my code:
<script lang="ts" setup>
import { PropType } from 'vue';
import { iStep } from '@/...
0
votes
1
answer
153
views
Vue - Eslint Complaining About Missing Variable in Setup Script
Funnily the Vue js documentation is highly suggesting to use the <script setup> syntax of the Composition API, the problem with it is that the documentation is very basic and it interferes with ...
0
votes
0
answers
33
views
How to access current route name from App.vue in Vue 3 script setup [duplicate]
I'm having trouble with getting current route name in App.vue in Vue3 script setup.
I would like to get the current route name and check if it matches some conditions.
The route is /login.
and the ...
1
vote
0
answers
1k
views
Using TipTap with Vue3+Composition API+TS
I'm using TipTap with Vue3, Composition API and typescript (script setup) and I've faced a problem. There is no documentation how to implement https://tiptap.dev/examples/interactivity vue ...
1
vote
2
answers
734
views
Unable to reference slot props inside template
I get the following warning in the browser when I try to reference the slot props. What am I missing?
[Vue warn]: Property "disabled" was accessed during render but is not defined on ...
2
votes
1
answer
2k
views
Vue 3 Component losing reactivity
I've been learning Vue 3 for the past month or so and have gotten quite far but I can't fix this no matter what I've tried. I know I'm losing reactivity but I can't figure out how and it's driving me ...
0
votes
1
answer
781
views
How can I use a custom name for a vue component?
The component I want to use with a custom name is defined as:
@/components/MyCustomName.vue
<template lang="">
<div>I'm here</div>
</template>
<script>
...
1
vote
0
answers
358
views
How to use jest.spyOn in wrapper.vm function?
I'm using vue-test-utils to test my components. They are written in composition API with <script setup> tag. I'm facing some difficulties when spying the functions to test if they were called or ...
0
votes
1
answer
521
views
How to load a dynamic image from a url in Nuxt3?
I have a nuxt 3 component which fails to load dynamic image that i'm getting from a specific URL(auth0 images).
My template looks like so:
<template>
<img class="h-28 w-28 rounded-...
0
votes
2
answers
2k
views
Vue 3 composition API pass array props through many children
I need to pass an array from component A (App.vue) through component B to component C. What I do is this (this first step works, just read it to understand):
// A.vue
<script setup>
import B ...
1
vote
2
answers
625
views
How to export reactive Vuex state from setup in Vue2.7
Here's a reproduction link: https://stackblitz.com/edit/node-c6mn17?file=src/components/Test.vue
I want to be able to use reactive state from that store using setup in Vue 2.7.
I export a Vuex store ...
3
votes
2
answers
5k
views
How to clear "Slot 'default' invoked outside of the render function" warning? Vue3, Composition API
The full warning message:
[Vue warn]: Slot "default" invoked outside of the render function: this will not track dependencies used in the slot. Invoke the slot function inside the render ...
2
votes
2
answers
4k
views
How can I focus on an input that is dynamic in Vue 3?
I'm building an application in Vue 3 using Script Setup and Quasar where the user can add new input boxes by pressing the "New Space +" button. It's super annoying to have to click the ...
1
vote
1
answer
516
views
How to access SFC data properties from the parent not using $refs in Vue v3?
I have this Vue 3 SFC
<template>
<div>
Home component
</div>
</template>
<script>
export default {
name: 'Home',
icon: 'house-icon'
}
</script&...
2
votes
1
answer
942
views
Vue3 ts script setup syntax, Vitest $setup.helperFunction is not a function
im trying to write tests with Vitest for my vue3 component
this is my component code:
<script lang="ts" setup>
import { reactive, computed, ref, onMounted } from 'vue'
import { ...
0
votes
1
answer
2k
views
Merging interfaces and passing the result as a Prop to defineProps in Vue 3
In vue 3 composition API im trying to do the following:
<script setup lang="ts">
import { computed } from "vue";
// vue doesnt like this line (the export seems to be the issue)
export ...
0
votes
1
answer
197
views
Why is my component not reacting to the changes? Vue3
I have a child component that takes in some props to decide for a state:
export interface IProps {
selected?: boolean,
answered?: boolean
}
const {selected, answered} = defineProps<...