Where should I write using native js, in a vue-cli project?

sometimes, it is found that there are still not enough cases of Vue, wheels. But there are a lot of native js. But there are all kinds of problems when it is used in vue-cli, either undefined, or hook function is easily affected by life cycle and data update.
so, please change how to write native js in vue-cli.

Mar.10,2021

depends on how you use it. If it is only used by a component, you can import it through import and define it on Vue.prototype ;
if it is widely used, just introduce it directly through index.html . At this time, it is generally defined on window .

Menu