mirror of
https://github.com/lowdefy/lowdefy.git
synced 2025-02-23 14:39:32 +08:00
43 lines
1.3 KiB
YAML
43 lines
1.3 KiB
YAML
_ref:
|
|
path: templates/general.yaml.njk
|
|
vars:
|
|
pageId: CallMethod
|
|
pageTitle: CallMethod
|
|
section: Actions
|
|
content:
|
|
- id: markdown
|
|
type: Markdown
|
|
style:
|
|
'.markdown-body':
|
|
fontSize: 14px
|
|
properties:
|
|
content: |
|
|
The `CallMethod` action is used to call a method defined by another block.
|
|
|
|
### Parameters
|
|
- `blockId`: _String_ - The id of the block.
|
|
- `method`: _String_ - The name of the method that should be called.
|
|
- `args`: _Any_ - The arguments with which the method should be called. If this is an array, each item will be a positional argument to the method, else the args are only the first argument. (The arguments are spread if they are an array).
|
|
|
|
### Examples
|
|
|
|
Open a modal:
|
|
```
|
|
- id: toggle_modal
|
|
type: CallMethod
|
|
params:
|
|
blockId: my_modal
|
|
method: toggleOpen
|
|
```
|
|
|
|
Display a message with args:
|
|
```
|
|
- id: display_message
|
|
type: CallMethod
|
|
params:
|
|
blockId: my_message
|
|
method: open
|
|
args:
|
|
content: Hello
|
|
duration: 4
|
|
``` |