Files
2023-12-11 11:27:48 -05:00

20 lines
450 B
JavaScript

module.exports = function (context, options) {
return {
name: 'plugin-dynamic-routes',
async contentLoaded({content, actions}) {
const {routes} = options;
const {addRoute} = actions;
routes.forEach((route) => {
addRoute({
path: route.path,
exact: route.exact || false,
component: route.component,
customProps: route.customProps || {},
});
});
},
};
};