# Router

Routing core logic.

# Basic usage

According to the routing table, match the corresponding route name.

import { findRouteName } from '@tencent/press-ui/common/router-helper/find-router-name';

const { name, params, path, meta } = findRouteName(rawPath, ALL_ROUTES) || {};

# common problem

# Implementation principle

The core is regular matching. With the help of path-to-regexp library, the routing table will be converted into corresponding regular rules, and then which route is matched will be returned.

横屏
Last Updated: 4/15/2025, 11:37:26 AM