mirror of
https://github.com/lowdefy/lowdefy.git
synced 2025-02-23 14:39:32 +08:00
58 lines
1.6 KiB
YAML
58 lines
1.6 KiB
YAML
# Copyright 2020-2021 Lowdefy, Inc
|
|
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
# you may not use this file except in compliance with the License.
|
|
# You may obtain a copy of the License at
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
# See the License for the specific language governing permissions and
|
|
# limitations under the License.
|
|
|
|
_ref:
|
|
path: templates/actions.yaml.njk
|
|
vars:
|
|
pageId: CallMethod
|
|
pageTitle: CallMethod
|
|
filePath: actions/CallMethod.yaml
|
|
types: |
|
|
```
|
|
(params: {
|
|
blockId: string,
|
|
method: string,
|
|
args?: any[]
|
|
}): void
|
|
```
|
|
description: |
|
|
The `CallMethod` action is used to call a method defined by another block.
|
|
params: |
|
|
###### object
|
|
- `blockId: string`: __Required__ - The id of the block.
|
|
- `method: string`: __Required__ - The name of the method that should be called.
|
|
- `args: any[]`: The array of positional arguments with which the method should be called.
|
|
|
|
examples: |
|
|
###### Open a modal:
|
|
```yaml
|
|
- id: toggle_modal
|
|
type: CallMethod
|
|
params:
|
|
blockId: my_modal
|
|
method: toggleOpen
|
|
```
|
|
|
|
###### Display a message with args:
|
|
```yaml
|
|
- id: display_message
|
|
type: CallMethod
|
|
params:
|
|
blockId: my_message
|
|
method: open
|
|
args:
|
|
- content: Hello
|
|
duration: 4
|
|
```
|