1,666 questions
Advice
0
votes
2
replies
73
views
Watchers and computed properties - getter function
I've been learning Vue for my project (Composition API) and so far there is one thing that I can't get my head around. Let's say we have a reactive object:
const obj = reactive({ count: 0 })
And I ...
0
votes
0
answers
62
views
QuillEditor --> add Module Placeholder
I wanted to add the placeholder-module in my quill-editor. I have installed the quill-placeholder-module. Whenever I tried to register it in OnMounted, it throws an error:
index.ts:35 quill Cannot ...
0
votes
1
answer
55
views
Why does inject() return the value of a ref from a reactive object instead of a reactive reference?
I'm working with Vue 3's Composition API, and I’m trying to provide a ref that is part of a reactive object. However, when I inject it in a child component, I get the raw value, not the reactive ref.
...
0
votes
2
answers
95
views
Watching i18n-vue's locale doesn't work in production
This code works only locally. In prod or stg build there are no logs in console and language code doesn't change, but the language is updated correctly across the UI.
<template>
<div>
...
1
vote
1
answer
29
views
Global Data Flow Issue
On Vue-based environment, global products item state is declared to be used in products list component, and other components like navbar for categories dropdown:
import axios from "axios";
...
1
vote
0
answers
135
views
Vue 3 Pinia State and Architecture Best Practices For Parent/Child Relationships With SignalR
My project is in Vue 3 (Composition API) w/ Pinia and SignalR
Here is an example of what I'm working with:
I have a parent object, let's call it Oven, and a child object called Bread.
There is a ...
0
votes
0
answers
54
views
Maximum recursive updates exceeded error when pushing/replacing existing route with different parameter
when using the selctCategory function to replace the existing route parameters, I receive an error that states
"devices:1 Uncaught (in promise) Maximum recursive updates exceeded in component . ...
1
vote
0
answers
60
views
Nuxt 3: Meta Tags Not Updating in "View Page Source" but Visible in DevTools
Description:
I'm using Nuxt 3 with useHead() to set dynamic meta tags based on locale. The meta tags appear correctly in the Elements tab (DevTools) but are missing in "View Page Source".
...
0
votes
0
answers
76
views
Composable reactivity within a mix of options and composition APIs
"vue": "^2.7.16"
"nuxt": "^2.18.1"
"@nuxt/bridge": "^3.3.1"
I have a composable that is using Composition api.
import {
ref,
reactive,
} ...
1
vote
1
answer
79
views
How to use a store initial value in a template Vue 3
I haven't worked with Vue for a while and now I am struggling with something that seems simple.
I have a store where I plan to keep a state for the whole app. Currently I only have one boolean ...
1
vote
1
answer
49
views
How to use regEx in Vue3 CompositionAPI whth Vuelidate?
How to check a form for a regex rule by using Vuelidate. It is clear from the guide that you need to use "helpers", however, when checking for the validity of a regular expression, Vuelidate ...
0
votes
0
answers
31
views
How to recover a file downloaded from a child component?
In my child component, I have an input file field that I need to retrieve from the parent component, to submit all the form data.
Unfortunately, I can't retrieve the data from my input file.
Can you ...
1
vote
1
answer
46
views
vuejs unexpected content behavior when changing array of child components with slots
I want to make a custom carousel which displays multiple slides at once and moves by one slide on a button press. In the main view this is how it is defined:
<MultiItemCarouselComponent>
<...
1
vote
0
answers
414
views
Vue 3.5 + TypeScriptt is possibly null error on useTemplateRef
I'm getting "value is possibly null" flags in VS Code with TypeScript in my when I use useTemplateRef.
Of this kind: audioPlayer.value.pause() is possibly null
Only if I add the non null ...
0
votes
0
answers
49
views
give tab focus() on a component when rendering in vue
I have button icon which is a separate component. I need to give the tab focus on this element after page is rendered. I am using Composition API in Vue 3. I tried adding ref to this component but it ...
1
vote
1
answer
98
views
What is 'effect' on Vue computed properties
If I inspect a computed property in Vue 2.7, I can see that, besides the well-known .value property, there's also .effect. I wasn't able to find any information about it, except that it's deprecated ...
0
votes
0
answers
64
views
Prohibit attributes for components in Vue Composition API
Allowance of any attributes for components creates problems for me.
Playground
For example taking this:
<script setup lang="ts">
import { ref } from 'vue';
import Checkbox from './...
0
votes
1
answer
212
views
Vitest not registering that spy has been run
Here is my view component:
<template>
<begin-adult-app-form
:form-status="formStatus"
:form-submitted="formSubmitted"
v-on:form-valid=&...
0
votes
2
answers
358
views
Dynamically removing items from refs in Vue.js 3
I'm trying to toggle references on and off in Vue. This is how I'd like to do it (or something similar) by having a conditional :ref="option.selected? 'foobar': null" on the items:
<...
1
vote
1
answer
23
views
Check when data loaded using several composable files
i have several composable file like:
File one:
export const useLoadUserData = () => {
const loadData = async () => {
// some staff
}
onMounted(async () => loadData())
}
File two:
...
0
votes
0
answers
141
views
How to deal with <script-setup> component imports and eslint rules like no-unused-vars
When using Vue
composition API with <script setup>, components are just imported like
import Component from '@/components/Component.vue';
How do I keep eslint from applying the no-unused-var ...
1
vote
2
answers
561
views
How can I make Axios globally available in a Vue 3 application using the Composition API with TypeScript?
I've tried using provide/inject:
plugins/axios.ts:
import axios from 'axios'
import type { AxiosInstance } from 'axios'
import type { App } from 'vue'
export default {
install: (app: App, baseUrl:...
1
vote
1
answer
1k
views
Route parameter typing error with TypeScript and unplugin-vue-router
I'm learning Vue 3 with the Composition API using TypeScript. One of the tutorials I'm doing suggests using unplugin-vue-router to autogenerate routes based on file naming/path conventions. The plugin ...
4
votes
2
answers
195
views
Vue component not updating ref while using Pinia
Omitted import statements for the sake of being concise
inputData.ts
export const useInputDataStore = defineStore("inputData", {
state: () => {
return {
...
0
votes
1
answer
36
views
Infer type of callback argument into one of the returned function
I have composable function like this:
export function useAppModal(beforeOpen?: <???>) => void) {
const modal = ref()
// calling open with any arguments will be passed to beforeOpen ...