Reputation: 8140
I am using the FlipClock.js Vue Component.
My code looks like the code below, and is called from another vue component:
import { FlipClock } from '@mvpleung/flipclock';
export default {
...
components: {
FlipClock
}
}
...
<flip-clock :options="{clockFace: 'Counter', autoStart: false}" />
How can I now manipulate the FlipClock component and for example call the increment method of it?
this.$refs is undefined
Upvotes: 0
Views: 103
Reputation: 2391
Your <flip-clock :options="{clockFace: 'Counter', autoStart: false}" />
need to add ref
attribute like <flip-clock ref='flipClock' :options="{clockFace: 'Counter', autoStart: false}" />
.
After call this.$refs.flipClock.increment()
Upvotes: 2