How to pass in the window object when vue introduces the native js plug-in

there is a plug-in written by native js: springy.js , which uses the window object.
the traditional script tag is introduced to automatically pass in window objects.

but how do you do this under vue?

spring.js plugin format:

clipboard.png
this:

clipboard.png

If

is introduced in the traditional way, the this points to the window object, so the window object will be used normally.
but under vue, this will be undefined .

excuse me, is there any good solution?

Jun.11,2021

imports-loader, you can try

clipboard.png

https://webpack.js.org/loader.


main.js
import springy from './...'
Vue.prototype.springy = springy;

can also be introduced using script tags under vue

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b2b4fd-2ba8e.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b2b4fd-2ba8e.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?