Skip to main content
Filter by
Sorted by
Tagged with
3 votes
3 answers
8k views

I have the following in my project... const basicRecords = reactive([]); It basically just houses an array of objects. I want to be able to refresh this array, that would require me to remove all of ...
3 votes
1 answer
9k views

I have created a Simple State Management with Reactivity API My Store file looks like the following: import { reactive, watch } from "vue"; const state = reactive({ form : { ...
26 votes
3 answers
21k views

I am upgrading an app from vue 2 to vue 3 and I am having some issues with composables. I'd like to use props in the composable but it doesn't seem to be working. The code sample is pulled from a ...
17 votes
7 answers
52k views

The export default statement does not seem to work inside <script setup>. If I try to export it in test.vue: <template> <div id="test" class="test"> </div&...
0 votes
0 answers
83 views

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? ...
24 votes
5 answers
34k views

I'm facing an error with vue3, ts, vue cli where it says Module '"c:/Users/USER/Documents/top-secret-project/src/components/Features/Features.vue"' has no default export. when importing a ...
11 votes
5 answers
58k views

New to Vue in general and currently using 3.2.37, I possibly missunderstood the correct usage of composition api’s defineExpose directive as documented here: https://vuejs.org/api/sfc-script-setup....
2 votes
2 answers
2k views

I'm using TipTap, a Rich Text Editor and the way they handle props in vue components (composition api) is by importing them like so: <script> import { nodeViewProps } from '@tiptap/vue-3' ...
1 vote
1 answer
43 views

given a child component Foo.vue <template> ... <button @click="emit('bah', ...)">...</button> ... </template> <script setup> const emit = defineEmits(['...
2 votes
2 answers
63 views

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(() => {})....
5 votes
2 answers
14k views

I noticed that to make a template ref in Vue 3 composition api <script setup>, I should make a variable name with the exact same as the ref value. For example in Vue 3 documentation: <...
30 votes
2 answers
34k views

I am using the experimental script setup to create a learn enviroment. I got a selfmade navigation bar with open a single component. I am having trouble using the <component :is="" /> ...
1 vote
0 answers
577 views

I am using Vue 3 (Composition API) with Typescript. Here is my code. <script setup lang="ts" generic="T"> import { ref, Ref } from "vue"; const props = defineProps&...
2 votes
0 answers
188 views

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, ...
1 vote
0 answers
87 views

I have a page template that contains the following sub-component: <template> <ManageVacanciesAndMatchesTabVacancies @loading-data="setIsTabDataLoading" /> </template> And ...
0 votes
1 answer
215 views

I am trying to pass a prop between sibling elements (a card and an input) and so far it has not been successful. I have a button nested within a card element. When someone is pressing a button, I emit ...
105 votes
8 answers
136k views

Just like the title says, related Links: New script setup (without ref sugar) <template> <TopNavbar title="room" /> <div> {{ no }} </div> </template> ...
5 votes
4 answers
8k views

How can I target the element with test class inside this vue component: <template> <div id="test" class="test"> </div> </template> <script setup> ...
60 votes
5 answers
149k views

When defining custom events Vue encourages us to define emitted events on the component via the emits option: app.component('custom-form', { emits: ['inFocus', 'submit'] }) Using Vue 3's ...
3 votes
1 answer
1k views

I am currently building a login for a Vue app. In a tutorial (02/2021) I see that the colleague creates a setup method and imports a Vue reactive object into the component. Just to collect the form ...
4 votes
1 answer
3k views

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: ...
4 votes
2 answers
10k views

I'm following the Vue 3 documents on how to move to using the <script setup> tags to simplify my component code. One of the perks of using this setup is that you no longer have to use the export ...
0 votes
1 answer
91 views

I was wondering why this works: <template> <h1> You are on page {{ $route.params.page }}</h1> </template> but when I try to access the param from script setup as in <...
0 votes
1 answer
82 views

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
4k views

In my vue app, I want to watch route changes, and then react to the change. Here is an example where I simulate a route change. <script setup> import { ref, watch } from 'vue' import { ...
1 vote
1 answer
426 views

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 ...
1 vote
1 answer
50 views

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
14k views

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 ...
27 votes
4 answers
48k views

I want to add a v-model on a component but I got this warning: [Vue warn]: Component emitted event "input" but it is neither declared in the emits option nor as an "onInput" prop. ...
1 vote
2 answers
614 views

The script part: <script export> let categories=ref({}) let selectedCategory onMounted(async () => { getCategories() }) const getCategories=async () => { ...
16 votes
3 answers
23k views

I'm trying to replicate this, only with <script setup> tag which doesn't have this keyword. Template (from code that I'm trying to replicate) <swiper ref="swiper"> <swiper-...
1 vote
1 answer
72 views

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 ...
31 votes
4 answers
17k views

Options API: <script> import { defineComponent } from 'vue' export default defineComponent({ name: 'CustomName', // 👈 inheritAttrs: false, // 👈 setup() { return {} },...
0 votes
1 answer
36 views

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 vote
1 answer
2k views

I'm trying to set up my InertiaJs / VueJs 3 / Laravel application with a simple way to emit and listen to the events - commonly known as an event bus. I've done some digging and have come across the ...
-1 votes
1 answer
220 views

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 '@/...
-1 votes
1 answer
93 views

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=&...
0 votes
1 answer
159 views

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
2 answers
86 views

I'm trying to figure out how to pass updated props to child component. For example, // parent component // temp is an reactive object <Child :temp="temp"> and in Child component,when ...
2 votes
1 answer
526 views

So I have an existing project where I wanted to add testing suite with jest + vue testing library. Added necessary libs and configs and jest basic calc sum test passes. After that importing basic vue ...
0 votes
0 answers
33 views

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 ...
0 votes
1 answer
1k views

In this project, there's the user which is a js object, like this: const user = { "ID": id, "NAME": name, "EMAIL": email, ... } And here's the router on VueJS: { ...
1 vote
3 answers
4k views

<template> <RecyclablesPopup ref="LVP" class="inline-block m-5px"></RecyclablesPopup> </template> <script setup> import ...
1 vote
0 answers
1k views

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
3k views

I defined a props: interface Props { formList: BaseSearchFormListItemType[], inline?: boolean searchBtn?: { show?: boolean text?: string type?: string size?: string } } const ...
1 vote
2 answers
735 views

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 ...
87 votes
7 answers
177k views

How to add a global variable in Vue.js 3? In Vue.js 2 we use this in the main.js file: Vue.prototype.$myGlobalVariable = globalVariable
4 votes
2 answers
5k views

I am starting to use Vue3's SFC script setup syntax: https://vuejs.org/api/sfc-script-setup.html When I try to write unit tests for these components the Intellisense complains that the functions ...
58 votes
4 answers
118k views

(This question has been answered for JavaScript, see below, but this question is specific for TypeScript, which behaves differently) I'm trying to use async functionality in Vue3.0 using typescript. ...
0 votes
0 answers
173 views

Want to build a simple CRUD App to understand the Basics. I am using Vue3 + Pinia Store + API Platform. What i have: StudentsPage: here, i fetch Data from my API and display the Data in a Table (...