> For AI agents: the complete documentation index is available at /next/zh/llms.txt, the full documentation bundle is available at /next/zh/llms-full.txt.

# onTemplateBundleReady

APISummary
模板解码后提供可重用的 TemplateBundle。

## 语法

### Android

```java
public void onTemplateBundleReady(@NonNull TemplateBundle bundle);
```

#### 参数

- `bundle`: 可重复使用的 TemplateBundle，它非空但可能无效。

:::note

- 此回调默认禁用，您可以通过 LynxLoadMeta 中的 DUMP_ELEMENT 选项或 RECYCLE_TEMPLATE_BUNDLE 选项启用它。

:::

### iOS

```objc
- (void)onTemplateBundleReady:(LynxTemplateBundle *)bundle;
```

#### 参数

- `bundle`: 可重复使用的 TemplateBundle，它非空但可能无效。

:::note

- 此回调默认禁用，您可以通过 LynxLoadMeta 中的 enableRecycleTemplateBundle 选项启用它。

:::

### Harmony

```typescript
public onTemplateBundleReady(bundle: TemplateBundle): void;
```

#### 参数

- `bundle`: 可重复使用的 TemplateBundle，它非空但可能无效。

:::note

- 此回调默认禁用，您可以通过 LynxLoadMeta 中的 DUMP_ELEMENT 选项或 RECYCLE_TEMPLATE_BUNDLE 选项启用它。

:::

## 兼容性

**Compatibility Table**

**Query:** `lynx-native-api.lynx-view-client.on-template-bundle-ready`

[Source](https://github.com/lynx-family/lynx-website/tree/main/packages/lynx-compat-data/lynx-native-api/lynx-view-client/on-template-bundle-ready.json)

| Feature | Android | HarmonyOS | iOS | macOS | Windows | Web |
| --- | --- | --- | --- | --- | --- | --- |
| on-template-bundle-ready | Yes (1.0) | Yes (3.4) | Yes (1.0) | No | No | No |

**`on-template-bundle-ready`**

Provide a reusable TemplateBundle after template is decode.

**Specifications:**

