Generation

generate functionSat, 12 Nov 2022

split routes vuex and shopware

function splitRoutes(routes: RouteConfig[], splitAt: string): RouteConfig[] { const index = routes.findIndex(route => route.name === splitAt) // console.log(routes[index]) const vuexRoutes: RouteConfig[] = routes.slice(0, index) const shopwareRoutes: RouteConfig[] = routes.slice(index) return [vuexRoutes, shopwareRoutes] }

TypeScript
Generate More

Questions about programming?Chat with your personal AI assistant