---
title: "Ext.button.Split"
description: "xtype 为 splitbutton 的 Ext JS 原生组件参考。"
---

> Documentation Index
> Fetch the complete documentation index at: https://ag.879818327.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Ext.button.Split

源码定义：`ext-all-debug.js:60131`。分类：按钮、工具栏、菜单与标签页。

## 创建示例

```javascript
var component = Ext.create("Ext.button.Split", {
  xtype: "splitbutton",
  arrowCls: 'split',
  split: true,
  renderTo: Ext.getBody()
});
```

## 属性

| 属性 | 类型 | 默认值 | 说明 | 配置示例 |
| --- | --- | --- | --- | --- |
| `arrowCls` | `String` | `'split'` | 配置 `arrowCls` 对应的 CSS 类名。 | `arrowCls: 'split'` |
| `split` | `Boolean` | `true` | 控制是否启用 `split` 行为。 | `split: true` |

## 方法

| 方法 | 参数 | 说明 | 调用示例 |
| --- | --- | --- | --- |
| `initComponent` | `` | 初始化组件及其子项。 执行时会保留父类默认行为。源码涉及 `callParent()`、`addEvents()`。 | `component.initComponent()` |
| `setArrowHandler` | `handler, scope` | 设置 `arrowHandler`。 执行时会更新 `arrowHandler`、`scope` 状态。 | `component.setArrowHandler(...)` |
| `onClick` | `e` | 处理 `click` 回调。 执行时会派发 `arrowclick` 事件。源码涉及 `doPreventDefault()`、`maybeShowMenu()`、`fireEvent()`、`doToggle()`。 | `component.onClick(...)` |

## 事件

| 事件 | 说明 | 监听示例 |
| --- | --- | --- |
| `arrowclick` | 用户点击下拉箭头时触发。 源码在 `onClick()` 中通过 `fireEvent()` 触发。 | `listeners: { arrowclick: function () {} }` |

Source: https://ag.879818327.xyz/ext/navigation/button-split/index.mdx
