I am looking to develop a unique Javascript class that can be instantiated from a Vue component and have functions called on it similar to how it is done in C#.
public class MyCustomClass()
{
public MyCustomClass(string someParameter){
....initialization code utilizing "someParameter"
}
public String SomeAttribute {get; set;}
public void MyCustomMethod(){
....logic implementation here
}
}
When working with Vue, I typically import JavaScript "functions" using the "Import" keyword. However, in this case, I aim to import the entire object and invoke its functions. I am considering using an IIFE but not entirely certain if it's the correct approach. Therefore, my two questions are: 1) is this achievable and 2) if so, how should I organize it and how would I instantiate the object in the Vue code?