xgqfrms™, xgqfrms® : xgqfrms's offical website of cnblogs! xgqfrms™, xgqfrms® : xgqfrms's offical website of GitHub!

import { componentName as componentAlias} form module

import { componentName as componentAlias} form module

shit AntD message

import {
    Breadcrumb,
    Table,
    Input,
    Button,
    Switch,
    Modal,
    Radio,
    Form,
    message,
} from 'antd';

    // Service
    const createData = (params = {}) => {
        setIsModalLoading(true);
        createDesigner(params).then(res => {
            const {
                msg,
                status,
                message,
            } = res?.data ?? {};
            if(status === 200) {
                // 新增(创建)成功
                message.success(`${msg}`);
                onResetData();
                hideModal();
            }
        }).catch(err => {
            const {
                status,
                data: {
                    message: msg,
                },
            } = err;
            if(status === 417) {
                message.error(`${msg}`);
            }
        }).finally(() => {
            setIsModalLoading(false);
        });
    };

import {
    Breadcrumb,
    Table,
    Input,
    Button,
    Switch,
    Modal,
    Radio,
    Form,
    message as $message,
    // message as Message,
} from 'antd';



    // Service
    const createData = (params = {}) => {
        setIsModalLoading(true);
        createDesigner(params).then(res => {
            const {
                msg,
                status,
                // message,
            } = res?.data ?? {};
            if(status === 200) {
                // 新增(创建)成功
                // message.success(`${msg}`);
                $message.success(`${msg}`);
                onResetData();
                hideModal();
            }
        }).catch(err => {
            const {
                status,
                data: {
                    message: msg,
                },
            } = err;
            if(status === 417) {
                message.error(`${msg}`);
            }
        }).finally(() => {
            setIsModalLoading(false);
        });
    };


refs



©xgqfrms 2012-2020

www.cnblogs.com 发布文章使用:只允许注册用户才可以访问!

原创文章,版权所有©️xgqfrms, 禁止转载 🈲️,侵权必究⚠️!


posted @ 2021-04-15 11:23  xgqfrms  阅读(51)  评论(2编辑  收藏  举报