I got a class, that was defined in the same Component File, but out of scope for the data, that i am exporting. I'd like to simply call the function, that was defined inside the "export default", but as i am doing, I'm getting the following error, as the map function is not inside the scope:
Test.vue?t=1751457112648:55 Uncaught TypeError: this.map is not a function` -
That is the file i am working with:
<template>
</template>
<script>
class SimpleTest {
pong() {this.map();}
}
export default {
name: 'Test',
data() {
return {
init: false,
}
},
methods: {
map() {return "Simple Return";},
},
mounted() {
let simpleOne = new SimpleTest();
simpleOne.pong();
}
}
</script>