Closed rowild closed 3 years ago
I don't know anything about Vue, but if you can post a complete example somewhere I'll take a look.
The only thing I can see from your code is the way you're calling Peaks.init()
- you have extra ()
and if you intend this
to refer to your Vue component you need an arrow function:
Peaks.init(options, (err, peaks) => {
console.log('Peaks init invoked')
if (err) {
console.log(err.message)
return
}
this.peaks = peaks
this.onPeaksReady()
});
@chrisn Thank you very much ffor your feedback!
I tried both, the "function" way and the "fat arrow" way, and the extra "()" slipped in, but I actually don't use them. Anyway, "this.peaks" never is assigned any value, and "onPeaksReady" is never invoked...
However, it seems there is already a Vue-Peaks package: https://github.com/oncletom/vue-waveform-template/
I will try to find my way around that one. Maybe you'd like to put the react and this Vue version in the readme of your npm package? :-)
Thanks again! Till next time with another question...
You're welcome! I agree that having more examples would really help, so will look into that.
I try to implement Peaks with Vue, but iwthout success so far. The goal would be to have a basic example for Peaks with Vue to be posted here.
This is what I have so far:
initPeaks is called without any errors, but it seems,
Peaks.init
does not ever reach the first console statement. Which is weird, because if there is something wrongly defined in theoptions
variable, then it errors out to the console...What am I doing wrong?