0👍
You can merge thus object into one and than iterate over it, like this:
for (let route of [].concat(contactRoutes, userRoutes, customerRoutes)) {
baseRoutes[0].children.push(route);
}
This way you are interating over all your objects at once.
To use exported objects dynamically without specifing each one you can do something like this:
const allRoutes = [].concat(...Object.values(adminRoutes));
for (let route of allRoutes) {
baseRoutes[0].children.push(route);
}
- [Vuejs]-How to Transfer between " v-text-fields " with directional keys in vue.js
- [Vuejs]-Vue appropriate way to create a stats holder 1 out of 5, 3 out of 5
Source:stackexchange.com