I attempted to incorporate Vue with rainyday.js by following different resources, but unfortunately could not find any relevant information. Can anyone provide guidance on how to successfully implement rainyday.js with Vue?
<body onload="run();">
<img id="background" alt="background" src="" />
</body>
<script src="./js/rainyday.min.js"></script>
<script>
function run() {
var image = document.getElementById('background');
image.onload = function () {
var engine = new RainyDay({
image: this
});
engine.rain([
[1, 2, 8000]
]);
engine.rain([
[3, 3, 0.88],
[5, 5, 0.9],
[6, 2, 1]
], 100);
};
image.crossOrigin = 'anonymous';
image.src = 'http://i.imgur.com/N7ETzFO.jpg';
}
</script>
After modifying the run
function into mounted
, I encountered issues and it did not work as intended.