Open hifall opened 6 years ago
This example might help https://gist.github.com/baranovxyz/b71a097d87c08983c4df2340447c4e11
@baranovxyz Do yo know, by chance, how to properly import datamaps in a Vue+Typescript project? I'm getting errors that way, but the script itself works. The "clean" way would be import 'datamaps';
but that way I cannot initialize the map.
Edit:
Using require
in the constructor of the specific Vue component made it for me.
class xyz {
private DataMap: any;
private myMap!: any;
constructor() {
this.DataMap = require('datamaps');
}
public mounted() {
this.myMap = new this.DataMap({
// ...
});
}
}
@3c7 No, I don't, have not used TS in a while.
@hifall It is not perfect but consider VueDatamaps.
I am new to datamaps and to Vue (sort of). I'd like to use datamaps inside a Vue-based app. How would I go about doing it?
Thanks!