Skip to content

配置路由

运行环境: client
该文件中的代码将仅在浏览器中运行。导入包时请确保浏览器兼容性。

向 Slidev 应用添加自定义页面。

使用方法

创建 ./setup/routes.ts,内容如下:

./setup/routes.ts
ts
import { 
defineRoutesSetup
} from '@slidev/types'
export default
defineRoutesSetup
((
routes
) => {
return [ ...
routes
,
{
path
: '/my-page',
component
: () => import('../pages/my-page.vue'),
}, ] })

Vue Router 文档中了解更多关于路由的信息。

Released under the MIT License.