How to reuse some existing ES6 classes in Vue Js.
Have a class which has a variable being updated by observable.
class A {
public a: string;
someobservable.subscribe((a) =>{
this.a = a;
})
}
In vue.JS have created the object of this class.
Sample how property is been used:
created: {
objA = new A();
}
methods: {
getA() {
if(this.objA !== undefined){
return objA.a;
}
}
}
and in vue template:
<div>{{getA()}}</div>
The value in template gets out of sync with value of variable in class.
Is there any other way to use the property in Vue template that it keeps updating real time.