vue-composition-api Questions
2
Solved
I've seen a pattern of using props in of CompositionAPI very often,
that is use toRefs to make all entries of props ref.
I'm kind of confused by it.
For exmaple, from the Vue 3 official guide:
expo...
Amr asked 1/10, 2021 at 16:23
1
When working with Vue.js, the biggest problem I have faced was declaring a global function that can be used anywhere in the Vue application without any import.
I have tried Vue plugin. the custom V...
Urmia asked 15/4, 2023 at 22:8
4
Solved
I want to make search page which after I click its button will be redirected to another page. And this page will be like this
http://localhost:8080/search?q=foo
and my router index.js looks like t...
Hematuria asked 18/2, 2021 at 1:1
3
Solved
I'm having an issue with the linting for my Vue SPA. I'm using the defineEmits function from the script setup syntactic sugar (https://v3.vuejs.org/api/sfc-script-setup.html). The errors just do no...
Blevins asked 21/1, 2022 at 15:3
5
I have a vue composable that needs to fire an event. I naively set it up as follows:
*// composable.js*
import { defineEmits } from "vue";
export default function useComposable() {
// V...
Gladysglagolitic asked 26/5, 2022 at 16:18
10
trying to implement vue-i18n in a component with composition api.
I want to be able to set some translation messages inside of the onMounted hook. In the options api, I would use this.$i18n.setLoca...
Daliladalis asked 8/9, 2021 at 12:56
4
Solved
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...
Neap asked 27/8, 2022 at 16:49
2
Solved
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="" /&g...
Torp asked 26/2, 2021 at 10:40
5
Solved
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 f...
Mathematics asked 4/5, 2020 at 19:30
3
Solved
<script lang="ts">
import { Component, Vue } from 'vue-property-decorator'
import { CustomerContext, getCustomerRepository } from '@/composables/customerRepository'
@Component
expo...
Lothians asked 24/11, 2020 at 8:52
5
Solved
I try to write a container component "A" to layout a third-party component "Tree", in order to use A, I use "inheritAttrs" to get all props and event of "Tree&quo...
Gnarl asked 22/3, 2022 at 9:0
10
Solved
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)
s...
Adversity asked 13/4, 2020 at 9:17
5
Solved
I have setup mitt and trying to dispatch event to another component but I am having hard time because in the setup() method it doesn't have this for accessing app instance.
Here is what I tried:
im...
Jadotville asked 8/3, 2021 at 21:17
3
Solved
Is there any simple way (without creating custom helpers) to unref(arr) where arr contains objects with ref, computed and other reactive properties?
A simple way is just to iterate the list and the...
Castellan asked 24/5, 2021 at 17:32
14
Solved
This my old code with VUE 2 in Tabs component:
created() {
this.tabs = this.$children;
}
Tabs:
<Tabs>
<Tab title="tab title">
....
</Tab>
<Tab title="tab ...
Benempt asked 1/10, 2020 at 11:0
4
Solved
I maintain quite a large vue2 project, which among other libraries makes use of Vuetify, vue-class-component, vue-property-decorator and typescript. Example component:
(The component is simplified...
Barret asked 24/6, 2022 at 10:12
3
Solved
My "Generateur" component is sending props to my "Visionneuse" component. Everything works fine inthe browser, but I have this message in the console:
Set operation on key "...
Toxophilite asked 30/12, 2020 at 10:50
6
Solved
I need to update a reactive object with some data after fetching:
setup(){
const formData = reactive({})
onMounted(() => {
fetchData().then((data) => {
if (data) {
formData = data //ho...
Sobriquet asked 15/1, 2021 at 7:35
5
So I have been learning the Vue Composition API and was wondering what the difference between watchEffect and watch is. Watch says it's the same as the Vue 2 watch, so I'm guessing watchEffect is l...
Tilghman asked 3/3, 2020 at 15:47
5
Please see below code.
<template>
<div v-for="item in arr" :key="item">{{ item }}</div>
</template>
<script>
import { ref } from "vue";...
Sachikosachs asked 18/1, 2021 at 11:10
8
Solved
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">
Co...
Unrefined asked 27/4, 2020 at 5:48
2
Solved
I am struggling to work out what I am doing wrong to get TypeScript to understand that props.user is of type UserInterface, any advice or pointers would be amazing
[email protected], [email...
Tiedeman asked 21/6, 2021 at 20:29
3
Solved
I'm making a library in VueJS 3 using Composition API. I implemented Provide/Inject as mentioned in docs. But the property in child component is still undefined and I get following error in browser...
Vani asked 27/7, 2020 at 1:8
2
I'm currently working on a legacy Vue project. We're using Vue 2.x w/ Typescript, with the Options API.
I'd like to make the case to switch to the Vue Component API, and so far I think it's a reall...
Illomened asked 24/10, 2020 at 20:7
9
Solved
While Vue Composition API RFC Reference site has many advanced use scenarios with the watch module, there are no examples of how to watch component props.
Neither is it mentioned in Vue Composition...
Nevermore asked 1/12, 2019 at 13:14
1 Next >
© 2022 - 2024 — McMap. All rights reserved.