Having some trouble sharing a method in Vue across files. Despite trying various suggestions found through research, I haven't been able to make it work. I did manage to get mixins working within the same file, but couldn't figure out how to import them from another file.
Here's what works (just the import section under the script tag):
// import ipsecMixin from '../shared'
var ipsecMixin = {
methods: {
IpsecKodeRemote: function(
[code here...]
....
export default {
name: 'MurSerit',
props: {
....
},
mixins: [ipsecMixin],
computed: {
However, when I attempted to move the code to an external file and import it as shown in the commented-out section above, I encountered a component error:
var ipsecMixin = {
methods: {
IpsecKodeRemote: function(
[code here...]
export { ipsecMixin }
The error message reads:
vue.runtime.esm.js?2b0e:587 [Vue warn]: Error in render: "TypeError: Cannot read property 'components' of undefined"
found in
---> <Modl2l> at src/components/Modl2l.vue
<Form> at src/components/Form.vue
<HelloWorld> at src/components/HelloWorld.vue
<Home> at src/views/Home.vue
<App> at src/App.vue
<Root>
Any insights on why this error is happening and how to resolve it would be greatly appreciated.