返回
APIResponse<boolean>:result === true表示跳转成功
- 当
page不是大于等于0的整数时,会抛出参数校验异常
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
跳转到当前文件的指定页。
static jumpToPage(page: number): Promise<APIResponse<boolean>>;
| 参数 | 类型 | 说明 |
|---|---|---|
page | number | 目标页码,从 0 开始 |
APIResponse<boolean>:
result === true 表示跳转成功page 不是大于等于 0 的整数时,会抛出参数校验异常import { PluginCommAPI } from 'sn-plugin-lib';
/**
* 跳转到指定页的示例。
*/
export async function exampleJumpToPage() {
const res = await PluginCommAPI.jumpToPage(2);
if (!res.success) {
console.log('jumpToPage failed', res.error);
throw new Error(res.error?.message ?? 'jumpToPage 调用失败');
}
console.log('jumpToPage result', res.result);
return res.result;
}