unplugin-vue-router icon indicating copy to clipboard operation
unplugin-vue-router copied to clipboard

feat(extendRoutes): allow relative path overrides

Open robertmoura opened this issue 4 months ago • 1 comments

BREAKING CHANGE: allow relative path overrides

Closes https://github.com/posva/unplugin-vue-router/issues/341

  • Support relative paths for EditableTreeNode
  • Require absolute paths at the base of the tree and the root's children
  • Support relative paths in definePage and <route> block

Includes changes from https://github.com/posva/unplugin-vue-router/pull/431

Description

Relative paths in definePage and route block

Relative paths are converted to absolute paths. Here is an example:

src/pages/
├─ custom-root.vue
├─ layout.vue
└─ layout/
	└─ empty-folder/
		└─ custom-child.vue

custom-root.vue

// Absolute path is '/i-am-custom'
definePage({
    path: 'i-am-custom',
});

custom-child.vue

// Absolute path is '/layout/i-am-custom'
definePage({
    path: 'i-am-custom',
});

robertmoura avatar Oct 04 '24 05:10 robertmoura