I am having trouble importing an external JavaScript file that contains a Form Class into a Vue Component.
My File Structure is as follows:
js
- components
-- dashboard
--- dashboard.vue
- app.js
- form.js
I have attempted to import the Form Class using various methods, but I keep encountering errors.
import Form from '../../form.js'
import Form from '../../form'
import Form from './form'
The content of form.js is as follows:
export default class Form{
// Implementation Here
}
In dashboard.vue, my code snippet looks like this:
<template>
// Code
</template>
<script>
import Form from '../../form.js' <- not working
import Form from '../../form' <- not working
import Form from './form' <- not working
export default{
name: 'Dashboard',
data(){
return [
form: new Form({
field1: '',
...
})
]
}
}
</script>
If anyone could assist me with resolving this issue, it would be greatly appreciated. Thank you!