mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-12-14 10:39:18 +08:00
21 lines
491 B
Markdown
21 lines
491 B
Markdown
# toggleList
|
|
`toggleList` will toggle between different types of lists.
|
|
|
|
## Parameters
|
|
`listTypeOrName: string | NodeType`
|
|
|
|
The type of node that should be used for the wrapping list
|
|
|
|
`itemTypeOrName: string | NodeType`
|
|
|
|
The type of node that should be used for the list items
|
|
|
|
## Usage
|
|
```js
|
|
// toggle a bullet list with list items
|
|
editor.commands.toggleList('bullet_list', 'list_item')
|
|
|
|
// toggle a numbered list with list items
|
|
editor.commands.toggleList('ordered_list', 'list_item')
|
|
```
|