baidu / baidu/amis

Toast Action 不展示,已配置 env.notify 并加载 <ToastComponent />

Open
#8,191 3 comments 0 reactions 1 assignee Claimed by @lurunze1226 View on GitHub
need confirm
Dominant language
TypeScript
Stars
18.9k
Forks
2.7k
PR merge metrics
No merged PRs in 30d

Description

#### 描述问题:

请用一段清晰简洁的文字描述问题是什么...

Toast Action 不展示,已配置 env.notify 并加载

#### 截图或视频:

可以的话,尽可能提供截图或视频来补充描述你的问题...
1. Action 成功触发
Screen Shot 2023-09-21 at 3 27 41 PM
2. 显示 toastRef 仍为 null,进入不展示逻辑

#### 如何复现(请务必完整填写下面内容):

1. 你是如何使用 amis 的?
`sdk`、`npm` 或`其他`...
sdk

2. amis 版本是什么?请先在最新 beta 版本测试问题是否存在
"amis": "3.4.0-beta.12",

3. 粘贴有问题的完整 `amis schema` 代码:
```
import {
AlertComponent,
ToastComponent,
ToastConf,
ToastLevel,
render as renderAmis,
} from 'amis';
import { toast } from 'amis-ui';

import 'amis/lib/themes/antd.css';
import 'amis/lib/helper.css';
import 'amis/sdk/iconfont.css';

const LiveUIDJSON = {
type: 'page',
body: [
{
type: 'flex',
justify: 'space-between',
alignItems: 'center',
items: [
{
type: 'form',
wrapWithPanel: false,
// api: '/api/v1/test',
body: [
{
name: 'excel',
label: 'Import File',
type: 'input-excel',
level: 'primary',
className: 'm-b-sm',
onEvent: {
change: {
actions: [
{
actionType: 'toast',
args: {
msgType: 'success',
msg: 'Upload Success!',
},

},
],
},
},
},
],
};

const ENV = {
getModalContainer: () => document.querySelector('.amis-scope'),
notify: (type: ToastLevel, msg: string, conf?: ToastConf) =>
toast[type] ? toast[type](msg, conf) : console.warn('[Notify]', type, msg),
theme: 'antd',
};

export const Component = () => (




{renderAmis(LiveUIDJSON, { locale: 'en-US' }, ENV)}

);

```

5. 操作步骤
请简单描述一下复现的操作步骤...
执行

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.