Category "vuejs3"

How to `emit` event out of `setup` method in vue3?

I know I can call the emit method from the setup method, but is there any way to emit event from any other functions without passing the emit method from setup

How to pass an argument to Pinia store?

I'm making a session API call in main.js and using values from the response as the initial value for my root store. In vuex it's handled this like, DataService.

Vue.js 3 use autofocus on input with ref inside a method

I worked with Vue2, but I recently try Vue 3. I have simple problem: <input ref="myinput" /> <button @click="submitData" /> I want to set "focus"

Extract modelValue logic to composable

I'm transitioning from Vue 2 to Vue 3 and I'm having trouble with composables. I have a bunch of components that inherits modelValue. So, for every component th

Vue.js 3: Cannot import Vue global object

I'm going crazy trying to reconcile the Vue 3 CLI output into something that works with various tutorials and plugins that all use the Vue object, as in Vue.cre

How to make vue3 import async dynamic component work?

I am a beginner using vue3. We can use dynamic component like this: <script setup> import CommonLayout from "@/components/Layout/CommonLayout.vue"; </s

Vue 3 how to get information about $children

This my old code with VUE 2 in Tabs component: created() { this.tabs = this.$children; } Tabs: <Tabs> <Tab title="tab title"> .... <

How can I use async/await in the Vue 3.0 setup() function using Typescript

(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 fun

How to get selected option text in vue form multiselect?

Currently i'm working with vue-form multiselect( https://www.npmjs.com/package/@vueform/multiselect) which is a vue select component. In this select box i need

How to maintain proper typescript type on Vue component data?

I'm working on a Vue project that I'm updating to Vue 3 with typescript. I've found a strange behavior with the typescript parser/compiler. I have the followin

Vue3 webcomponents production build problem

I'm trying to migrate my vue2 webcomponent to vue3, although the problem comes when i'm creating a build for production. I was using the vue-cli with --target w

Does Vue 3 Teleport only works to port outside vue?

Vue 3 has a new Teleport feature which replaces the portal-vue plugin in vue 2. However, I found that it is impossible to port a component to a place that is co

Could vue3 <script setup> use component is, how to make it work?

I am new beginner of vue3 and found that vue have three way to write component: <script setup> normal-setup/composition api options api. I know how to use

Is it possible to access data / html context from root Vue 3 component

I have used Vue in the past but am struggling with how to pass information / args to a root Vue 3 component. In my html, I'd like to have something like this:

Uncaught TypeError: Cannot read properties of undefined (reading 'deep')

I am develop a google chrome extension using vue3 + typescript. I use v-link like this in the vue3 template like this: <li> <a v-link="{name:'about'

Uncaught TypeError: Cannot read properties of undefined (reading 'deep')

I am develop a google chrome extension using vue3 + typescript. I use v-link like this in the vue3 template like this: <li> <a v-link="{name:'about'

Uncaught Error: Module build failed (from ./node_modules/babel-loader/lib/index.js): SyntaxError: Unexpected token (24:11)

I am using vue 3 to develop a google chrome extension. I want return a simple div in Vue 3 render function, this is the code looks like: import client from './c

Uncaught TypeError: Cannot read properties of undefined (reading 'extend') after upgrade vue to 3.x

Today I upgrade my google chrome extension vue version to 3.x, when run the app, the google chrome extension popup console shows error like this: commons1.js:13

How to toggle to dark mode in Vue JS and Tailwind CSS

I want to toggle to dark mode in Vue JS and Tailwind CSS with Dark class in tailwind, but I don't have idea what I should do. I code a little and I want to try

How to create reusable toastService with primeVue toast?

I want to know if there's a way to create a reusable scritp/class/service with primevue toast function calls, in such a way that I don't need to call the primev