0๐
you are right is a simple js.
look at the example below, most importend thing is eval()
class Polygon {
constructor(height, width) {
this.height = height;
this.width = width;
}
get getHeight() {
return this.height
}
}
// js string code
var code = "new Polygon(15, 200)";
// convert it to code;
var cls = eval(code);
console.log(cls.getHeight)
- [Vuejs]-Correct way how to get and show data from specific JSON from API
- [Vuejs]-How do I fetch data from database in real time (vuejs)?
0๐
I found that using
this.$options.__proto__.components['MyComponent1']
works and do what I want. Is it the cleanest solution ?
Source:stackexchange.com