Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>route-treeNew to Visual Studio Code? Get it now.
route-tree

route-tree

yuneko

|
2 installs
| (0) | Free
在 React Router v5 项目中反向查找“当前组件被哪些页面路由使用”
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

route-tree

在 React 项目中反向查找「当前组件被哪些页面路由使用」的 VS Code 扩展(React Router v5)。

使用

  1. 在 VS Code 中打开任意组件文件(.tsx/.ts/.jsx/.js)
  2. Ctrl + Shift + P 执行命令:React: Show Pages Using This Component
  3. 在列表中选择路由条目后跳转到对应页面文件

路由约定

  • React Router:v5
  • 路由配置为静态对象数组
  • 支持示例(两种 component 写法):
{
  name: '页面名称',
  path: Paths.页面路径, // 也支持字符串字面量
  component: PageComponent
}
{
  name: '页面名称',
  path: '/order/list',
  component: <OrderList />
}

打包与发布

  • 打包:pnpm run package
  • 发布:pnpm run publish

发布到 VS Code Marketplace 前需要先创建并登录 publisher:

  1. 安装并登录 vsce 所需的 Personal Access Token
  2. 将 package.json 中的 publisher 改为你的 publisher id
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft