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 function
Here's the parent method that I'm trying to call:
methods: {
forceRender() {
this.componentKey += 1
}
},
And here's the child component as you can see I'm trying to call the parent method using the $parent
:
this.$parent.forceRender()
forceRerender
sounds like it's a bad idea. You usually should not have to do something like that. – Gardie