Skip to content

Commit c04dc56

Browse files
committed
Update docs
1 parent d567e0e commit c04dc56

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

docs/en/api/ContextMenuInstance.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ Global Function
2020
| Param | Description |
2121
| :----: | :----: |
2222
| options | The options of menu. |
23-
| customSlots | These slots to allow you to customize the style of the current menu, the names of these slots are the same as those in the [component mode](#ContextMenu). |
23+
| customSlots | These slots to allow you to customize the style of the current menu, the names of these slots are the same as those in the [component mode](#ContextMenu). For customization methods, please refer in [here](../guide/customize.md). |
2424

2525
Return
2626

2727
| Type | Description |
2828
| :----: | :----: |
29-
| ContextMenuInstance | The instance of the current menu, can calling 'closeMenu' to close this menu. |
29+
| ContextMenuInstance | The instance of the current menu, can calling `closeMenu` to close this menu, calling `isClosed` to check if the menu is currently closed. |
3030

3131
### `ContextMenu.closeContextMenu()`
3232

@@ -77,6 +77,7 @@ Global Function
7777
| adjustPosition | By default, the menu will automatically adjust its position to prevent it overflow the container. If you allow menu overflow containers, you can set this to false. | `boolean` || `true` |
7878
| direction | Set the mian menu pop-up direction relative to coordinates. Default is `'br'`, if `adjustPosition` is true then the menu will determine the pop-up direction based on its distance from the screen edge. | `'br' or 'b' or 'bl' or 'tr' or 't' or 'tl' or 'l' or 'r'` || `'br'` |
7979
| ignoreClickClassName | If your element in menu item has this className, click it will ignore event. | `string` ||
80+
| clickCloseOnOutside | Set should close menu when the user click on other places. | `boolean` | `true` |
8081
| clickCloseClassName | If your element in menu item has this className, click it will ignore event and close hole menu. | `string` ||
8182
| updownButtonSpaceholder | Determine whether the up/down buttons in the menu item require space holder. The purpose of this variable is because some menu themes add blank padding above and below the menu, which are just enough to place up/down buttons. If there is no blank padding in your custom menu theme, you can set this field to provide blank space for up/down buttons to prevent obscuring menu items. | `boolean` || `false` |
8283
| getContainer | Return the mounted node for MenuRoot. [Guide](../guide/custom-container.en.md) | `HTMLElement` or `(() => HTMLElement)` |||

docs/zh/api/ContextMenuInstance.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ import ContextMenu from '@imengyu/vue3-context-menu'
1919
| 参数 | 说明 |
2020
| :----: | :----: |
2121
| options | 菜单的数据 |
22-
| customSlots | 这些插槽允许您自定义当前菜单的样式,这些插槽的名称与 [组件模式 ContextMenu](./ContextMenu.md) 中的插槽名称相同 |
22+
| customSlots | 这些插槽允许您自定义当前菜单的样式,这些插槽的名称与 [组件模式 ContextMenu](./ContextMenu.md) 中的插槽名称相同,具体自定义方式,可参考[自定义文档](../guide/customize.md) |
2323

2424
返回值
2525

2626
| 类型 | 说明 |
2727
| :----: | :----: |
28-
| ContextMenuInstance | 当前菜单的实例,可调用 `closeMenu` 关闭菜单 |
28+
| ContextMenuInstance | 当前菜单的实例,可调用 `closeMenu` 关闭菜单;可调用 `isClosed` 检查当前实例是否已经关闭 |
2929

3030
### `ContextMenu.closeContextMenu()`
3131

@@ -76,6 +76,7 @@ import ContextMenu from '@imengyu/vue3-context-menu'
7676
| adjustPosition | 默认情况下,菜单将自动调整其位置,以防止溢出容器。如果允许菜单溢出容器,则可以将其设置为false。 | `boolean` || `true` |
7777
| direction | 设置主菜单相对于坐标的弹出方向。如果 `adjustPosition``true` ,则菜单会根据可用空间自动调整弹出方向。 | `'br'|'b'|'bl'|'tr'|'t'|'tl'|'l'|'r'` || `'br'` |
7878
| ignoreClickClassName | 若菜单项中的元素有这个className,单击它将忽略事件。| `string` ||
79+
| clickCloseOnOutside | 设置是否当用户点击其他位置时应关闭菜单。| `boolean` | `true` |
7980
| clickCloseClassName | 若菜单项中的元素有这个className,单击它将忽略事件,并且点击后会关闭菜单。| `string` ||
8081
| updownButtonSpaceholder | 决定菜单项中的上/下按钮是否需要空白占位。设置这个变量的目的是因为有些菜单主题会在菜单上下添加空白边距,这一部分空白边距刚好可以放置上/下按钮。如果你的自定义主题菜单中没有空白边距,则可以设置此字段为上/下按提供要空白占位,防止遮挡菜单条目。 | `boolean` || `false` |
8182
| getContainer | 自定义菜单挂载容器。[详情请参考](../guide/custom-container.md) | `HTMLElement` or `(() => HTMLElement)` |||

0 commit comments

Comments
 (0)