I am trying to use an external js file in my .vue file but get error:
[Vue warn]: Method "solarSystemAnimations" has type "object" in the component definition. Did you reference the function correctly?
found in
---> <SolarSystem> at src/views/SolarSystem.vue
<App> at src/App.vue
<Root>
I have the external js file at /src/assets/js/solarSystemAnimations:
export default $(window).load(function() {
var body = $("body"),
universe = $("#universe"),
solarsys = $("#solar-system")
...
};
and my .vue file looks like:
<template>
<div class="solarSystem" @load="solarSystemAnimations">
<div class="opening hide-UI view-2D zoom-large data-close controls-close">
....
</template>
<script>
import solarSystemAnimations from "@/assets/js/solarSystemAnimations.js";
export default {
name: "SolarSystem",
methods: {
solarSystemAnimations: solarSystemAnimations
}
};
</script>
I have looked thru numerous posts but nothing seems to work in my situation. Any help appreciated in advance.