Javascript code:
var main = new Vue({
el: "#main",
data: {
currentView: "top",
},
});
var topComponent = Vue.component('top', Vue.extend({
template: "#top",
}));
Now when I access main.currentView, I get "top". But with this string 'top', how do i get the component topComponent
?