Skip to content

Add option to apply custom naming function #17

@NisuSan

Description

@NisuSan

Add a new module option — e.g. namingFunction — that accepts a user‑supplied function. This function will be called for each route and should return the desired composable name. Internally, module will use this function instead of its default transformation:

// nuxt.config.ts
export default defineNuxtConfig({
  modules: ['nuxt-apex'],
  apex: {
    namingFunction: (relativeRoute: string) => {
      // user’s custom logic:
      // strip file extension, convert segments to PascalCase, etc.
      return myCustomNamer(relativeRoute)
    }
  }
})

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions