All Questions
99 questions
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 ...
4
votes
1
answer
2k
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:
...
1
vote
1
answer
48
views
Component isn't updating from computed value [duplicate]
I have a generic component linked to a computed value to simulate routing.
There is a current page property, and three links, whenever the user clicks on a link, that property gets updated via the ...
7
votes
1
answer
11k
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 ...
0
votes
1
answer
30
views
VueJS passing parameter to bound property
I want to track the state of several buttons without having a tracker variable and function for each.
So I want to pass a parameter through to a computed property, something like this:
<div class=&...
-1
votes
1
answer
85
views
Blank background-image in vue.js
For a website, i want 70% of the page to be covered with an image. However the image is just blank.
I use Vue.js as my frontend. Here is the code that results in a blank space:
<script setup lang=&...
1
vote
0
answers
958
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 ...
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
725
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
1
answer
680
views
Why some variables are inacessible in onMounted Lifecyle Hook in vue3 composition API?
I'm kinda new to composition API in vue3 and I'll be glad if someone could explain to me why...
this works:
<template>
<h1>{{ foo }}</h1>
</template>
<script setup>
...
1
vote
0
answers
344
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 ...
4
votes
1
answer
3k
views
Is there any problem if I use two onMounted() per one component?
I have only seen examples of one onMounted() per one component.
I'd like to use onMounted() for each feature.
Is there any problem?
MyComponent.vue
<script setup>
import { onMounted } from 'vue';...
1
vote
4
answers
4k
views
Why doesn't the component tag in Vue3 work properly for dynamically rendering components?
I'm just learning Vue and trying to learn dynamic rendering using the component tag. What is the problem with this code? No errors are displayed in the console, but clicking on the buttons still does ...
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 ...
0
votes
1
answer
494
views
Why is my bound data in a Vue 3 form not being updated when printed on the console via a function?
I have created a form component in Vue 3 where I am trying to bind a reference object to input elements and from my understanding of two-way binding and how Vue behaved for my past works, I expected ...