mirror of
https://github.com/lowdefy/lowdefy.git
synced 2025-02-23 14:39:32 +08:00
69 lines
1.9 KiB
YAML
69 lines
1.9 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: MessageAction
|
|
pageTitle: Message
|
|
filePath: actions/Message.yaml
|
|
types: |
|
|
```
|
|
(params: {
|
|
status?: enum,
|
|
duration?: number,
|
|
content?: string,
|
|
}): void
|
|
```
|
|
description: |
|
|
The `Message` action is used to display a message to a user.
|
|
params: |
|
|
###### object
|
|
- `status: enum`: Message status type. Defaults to `success`. One of:
|
|
- `success`
|
|
- `error`
|
|
- `info`
|
|
- `warning`
|
|
- `loading`.
|
|
- `duration: number`: Time in seconds before message disappears. The default is 5.
|
|
- `content: string`: The content of the message.
|
|
examples: |
|
|
###### Display a success message:
|
|
```yaml
|
|
- id: success_message
|
|
type: Message
|
|
params:
|
|
content: Success
|
|
```
|
|
|
|
###### Display an info message that remains visible for 10 seconds:
|
|
```yaml
|
|
- id: info_message
|
|
type: Message
|
|
params:
|
|
content: Something happened
|
|
status: info
|
|
duration: 10
|
|
```
|
|
|
|
###### Display an error message that never disappears:
|
|
```yaml
|
|
- id: error_message
|
|
type: Message
|
|
params:
|
|
content: Something bad happened
|
|
status: error
|
|
duration: 0
|
|
```
|