Skip to content

Tag: vuejs3

VueJs 3 – Custom Input Component

I’m trying to build a custom HTML <input> component for VueJS3. I’ve been following this tutorial: https://dev.to/viniciuskneves/vue-custom-input-bk8 So far I managed to get the CustomInput.vue component to work and emit the modified value back to the parent App.Vue. What I don’t understand is – how will the emitted events be detected by the parent App.vue component? I can’t see it

I run into problems when i add “.slice()” to the line of code

I’m new to vue.js. I’m making a fast typing application. Everything was as it should be, but when I wrote and ran this line of code, I got this error in the terminal: **INFO Starting development server… 98% after emitting CopyPlugin ERROR Failed to compile with 1 error 23:59:37 This dependency was not found: core-js/modules/es.array.slice.js in ./node_modules/cache-loader/dist/cjs.js??ref–13-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref–1-0!./node_modules/vue-loader-v16/dist??ref–1-1!./src/components/Main.vue?vue&type=script&lang=js To install it,

In Vue3 changing root state stopped working

My mutations which changes root state stopped working But changing inner value is working Answer This state = … changes state local variable (parameter), it cannot affect anything that happens outside this function. { …state, …payload } shouldn’t be done in Vue because it doesn’t force immutable state the same way as React. Initial state should be generally set on

Vue 3 Composition API state not updating when use function [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers. Want to improve this question? Update the question so it’s on-topic for Stack Overflow. Closed last month. Improve this question I have wasted my time for this. I am using Vue 3 options API previously and I am trying change to compostion API.

How to make Provide and Inject Reactive in Vue?

I am trying to pass data using provide and inject but the injected data is not reactive, can any help me to make it reactive. I am changing the ‘ParentName’ after 3 sec using mounted hook’ In child component, i am injecting the value But I am getting the injected name as ‘Initial Value’, not getting the updated value as

Vuejs Iterate through a ref object

I have a small problem, I get my ref object from that method And i want to use another method using that ref object : But i can’t iterate through : Is there anyway to make that work ? Thank you 🙂 Answer As the response is an object and not an array, you cannot iterate over it with forEach,

Vue 3 defineEmits breaks defineProps types

I’m using Vue 3 and TS 4.4. I’ve got a component that defines its prop types with defineProps. When I add a call to defineEmits, VS Code starts telling me my props variable doesn’t exist in the component template. Here’s the source code: And a couple of screenshots to better show what I’m seeing in VS Code. This is after