Questions tagged [vuejs3]
Use this tag for questions specific to version 3 of Vue.js, an open-source, progressive Javascript framework for building user interfaces.
vuejs3
13,539
questions
65
votes
5
answers
118k
views
Vue 3 Composition API - How to get the component element ($el) on which the component is mounted?
I want to use onMounted to initiate a third-party library. To do that I need the component element as its context. In Vue 2 I would get it with this.$el but not sure how to do it with composition ...
0
votes
0
answers
70
views
Changing a hard-coded prop on an imported component doesn't trigger HMR
I've been playing around with vue-next (version 3 of vuejs) and ran into an issue with HMR. Here's a rundown of my environment and the problem but:
TL;DR; - Hard coded props don't trigger HMR on an ...
3
votes
1
answer
791
views
How to apply CSS to the root of a Vue 3 component?
I am moving Vue 2 source over to Vue 3 (beta), and came across this:
<template>
<section id="this"> <!-- how to eliminate this? -->
<div>
YOU ARE AT HOME 🏯
&...
10
votes
4
answers
9k
views
Why dynamic component is not working in vue3?
Here is a working Vue2 example:
<template>
<div>
<h1>O_o</h1>
<component :is="name"/>
<button @click="onClick">Click me !</button>...
2
votes
1
answer
1k
views
Vue3 - Composition Function vs. import { functionObject } from 'module'
So I just read through the new Composition API RFC (link).
Here they compare multiple methods to reuse code across components.
Therein the import from module method is not included. I guess that's ...
253
votes
8
answers
129k
views
ref vs reactive in Vue 3?
Looking at some examples of some people's preview tutorials for Vue 3. [Currently beta right now]
I've found two examples:
Reactive
<template>
<button @click="increment">
...
0
votes
1
answer
331
views
vuejs Datable is not working with api's fetched data
I want to display the data in table using vue-datatable but it is not working.
Here is the code that i am using ,i am getting data in json format but it is not appending with datatable
can anyone help ...
1
vote
1
answer
1k
views
v-model updated in code but not on screen using Vuetify.js
I have a problem:
I have 4 fields in a data object: contact_id, contact_child_id, address_id, address.
When contact_id OR contact_child_id OR address_id are changed, the address is updated.
...
0
votes
1
answer
39
views
Vue Typecript: declaring data with type
How can I achieve the following similar in Vue with Typescript?
DocumentReference docRef = null
export default Vue.extend({
...
...
data: function(){
return {
docRef: ...
6
votes
1
answer
12k
views
Vue 3 recommended TypeScript TSConfig compilerOptions TARGET setting?
This question has puzzled me at several points when using Vue 2 and Vue CLI, and now again with starting a fresh Vue 3.0 beta project.
Even with the currently newest Vue CLI version 4.3.1, when ...
1
vote
1
answer
3k
views
How do you set up Vue 3 main.js file with extra imports?
Hi I'm trying to do the vue 3 version of main.js file that works in vue 2
vue 2
import Vue from "vue";
import App from "./App.vue";
import store from "./store";
import Amplify, * as AmplifyModules ...
9
votes
1
answer
3k
views
Vue 3 what is the class-Based API, function-based API, Reactivity API and composition API
When I started working with vue 3, I saw these notions :
Object-based API
Function-based API
Class-Based API
Composition API
Options API
Reactivity API
Can some one tell us the definitions of these?
...
0
votes
2
answers
894
views
Vue.js 3 optional v-scroll-to
Here is the code that I use.
<template>
<div class="button-layout" :style="`margin: ${margin}; text-align: ${align};`">
<component
:is="buttonComponent"
v-for="(...
35
votes
10
answers
36k
views
How to properly reset Vue Composition Api's reactive values
I'm wondering how should I reset a reactive in vuejs setup? (i know if change it to the ref and using view.value will solve this problem, but there should be an answer to this for using reactive)
...
20
votes
1
answer
21k
views
How to access dynamic ref-tagged html elements in Vue.js 3?
Using the Vue.js 2 api-composition, you have a .ref attribute on the setupContext argument of setup(). As stated in many articles and in this thread : https://github.com/vuejs/composition-api/issues/...