1👍
export default class Authenticator {
// ...
}
And import in file:
import Authenticator from "path/to/file/authenticator.js
var Auth = new Authenticator ();
- [Vuejs]-Unity WebGL Build Won't Even Appear in Nuxt/Vue App – Could not find a declaration file for module 'unity-webgl'
- [Vuejs]-How i can order like a index book in Javascript?
0👍
Pretty hard to help without your code, but here’s a basic example:
Authenticator.js
'use strict';
class Authenticator {
// ...
};
module.exports.Authenticator = Authenticator;
Login.vue
<script>
import Authenticator from 'path/to/Authenticator.js';
const AuthenticatorInstance = new Authenticator;
// use it...
</script>
0👍
Authenticator.js
class Authenticator {
//
};
export default new Authenticator;
Login.vue
<script>
import Authenticator from 'path/Authenticator';
</script>
Source:stackexchange.com