Skip to content

Instantly share code, notes, and snippets.

@dlodeprojuicer
Last active April 23, 2020 10:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dlodeprojuicer/7fe327ed93a3e878168fb087e5c6d1db to your computer and use it in GitHub Desktop.
Save dlodeprojuicer/7fe327ed93a3e878168fb087e5c6d1db to your computer and use it in GitHub Desktop.
Dynamic route step 2
requireModule.keys().map(file => {
// filename string example `./Home.vue`
const moduleName = file.split("/")[1].split(".vue")[0];
const url = moduleName.replace(/([a-zA-Z])(?=[A-Z])/g, "$1-").toLowerCase();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment