Skip to main content

All Questions

2 votes
1 answer
8k views

TypeError: this.$refs is not a function

So I have a problem with VueJs. I created a "Confirmation Dialogue" and added it to a On-Click-Event on buttons. It worked fine. Now I tried to copy the implementation to add it to another ...
Joshua's user avatar
  • 61
3 votes
1 answer
3k views

Nuxt / Vue : Component call a Method in a page

There is my issue: My page listing.vue list all products. Theses products are in a Component, Product.vue. In this component, there is a button to add this product to a selection, displaying on the ...
Vin Parker's user avatar
6 votes
3 answers
6k views

Call parent method in child component using vue.js

I just want to know how to call a parent function from a child component. I've tried to use the $parent to call the parent method, but I get this error TypeError: _this.$parent.forceRender is not a ...
Samy Tcheikman's user avatar
2 votes
1 answer
704 views

Vue - Component won't re-render when updating data with a method

I have a very simple vue components that looks like this: <template> <div class="incrementor"> <p v-text="counter"></p> <button v-on:click="increment()">...
urieow jfkdls's user avatar
0 votes
0 answers
568 views

How to place a component's logic outside the file .vue itself

I'm building a webapp in Nuxt.js and it's growing quite a bit. I have a page which does two things: one when i'm creating a task and one when managing that task. This page has a lot of methods, ...
Mattia's user avatar
  • 85
2 votes
3 answers
8k views

How to test an Error of a Method in a Vue.js Component using jest

How can I test the method createUser() of my Vue component? I want to test if the createUser() method throws an Error if the firstname < 2 for example. How is this possible? I'm not really ...
TGee's user avatar
  • 41
0 votes
0 answers
38 views

Define generic component methods from the view VUE [duplicate]

I have a simple component with a button, which is implemented in the view. I would like that depend of the views, this button (which is in the component) works different How to define the method in ...
sarnei's user avatar
  • 277
1 vote
1 answer
174 views

How to run component's method via HTML in Vue2

I have a .vue file, ServiceList, which imports the component Information.vue. I would like to run Information's code in a loop in ServiceList's template like so: ServiceList.vue <template> &...
A. A. Pedersen's user avatar
16 votes
1 answer
49k views

How to check when data changes in component by itself with vue js?

I have method that changes data in itself, simple example: Vue.component('component', { template: '#component', data: function () { return { dataToBeWatched: '' } }, methods: { ...
Jarvis's user avatar
  • 415
1 vote
2 answers
2k views

Why won't VueJS invoke methods from the created() function?

Learning VueJS and trying to do a simple API call on component load to put a list of repos onto my page. When I call and set the this.repos from the created() method, no problem. But if I set it as a ...
Anthony's user avatar
  • 65