1
Hello! I have a restAPI that returns me a array
of names, I wanted to know how I do to get them as componentes
. Below you can understand better:
import produtos from './produtos'
import artigos from './artigos'
var API_Request = ["produtos", "artigos"]
var router = [ ...API_Request ]
const app = new Vue({
router
}).$mount('#container')
The API_Request
comes as string
, how do i convert it to components that were imported above?
Thank you!
These Api_request strings are always some of the modules you know to have right? ie you can have
import
of x modules that the API will always refer to them right?– Sergio
These Api_request strings always come modules that I’m sure I have
– Jackson