> ## Documentation Index
> Fetch the complete documentation index at: https://docs.supernote.com/llms.txt
> Use this file to discover all available pages before exploring further.

# getLastElement

> 获取当前笔记当前页的最后一个元素。

```ts wrap theme={null}
static getLastElement(): Promise<APIResponse<Element>>;
```

**返回**

* [`APIResponse<Element>`](/zh/api-reference/supernote-plugin/types/api-response)：
  `result` 为[`Element`](/zh/api-reference/supernote-plugin/types/trail)对象。

## 示例

```ts wrap theme={null}
import { PluginFileAPI } from 'sn-plugin-lib';

/**
 * 获取当前笔记当前页最后一个元素的示例。
 */
export async function exampleGetLastElement() {
  const res = await PluginFileAPI.getLastElement();
  if (!res.success) {
    throw new Error(res.error?.message ?? 'getLastElement 调用失败');
  }
  return res.result;
}
```
