@cainiaofe/cn-ui-m
Version:
80 lines (79 loc) • 4.04 kB
JavaScript
import * as React from 'react';
import { CnButton, CnCard, CnDemoPage, CnDialog } from "../../..";
export var 快捷调用 = function () {
return (React.createElement(CnDemoPage, { title: "\u5FEB\u6377\u8C03\u7528" },
React.createElement(CnCard, null,
React.createElement(CnButton, { fullWidth: true, type: "primary", style: { marginBottom: 10 }, onClick: function () {
CnDialog.success({
title: '快捷调用',
content: '成功窗口的快捷调用',
okProps: {
children: '知道了',
},
onOk: function () { return console.log('OK'); },
});
} }, "Success"),
React.createElement(CnButton, { fullWidth: true, type: "primary", style: { marginBottom: 10 }, onClick: function () {
CnDialog.error({
title: '快捷调用',
content: '错误的快捷调用',
okProps: {
children: '知道了',
},
onOk: function () { return console.log('OK'); },
});
} }, "Error"),
React.createElement(CnButton, { fullWidth: true, type: "primary", style: { marginBottom: 10 }, onClick: function () {
CnDialog.warning({
title: '快捷调用',
content: '警告的快捷调用',
okProps: {
children: '知道了',
},
onOk: function () { return console.log('ok'); },
});
} }, "Warning"),
React.createElement(CnButton, { fullWidth: true, type: "primary", style: { marginBottom: 10 }, onClick: function () {
CnDialog.notice({
title: '快捷调用',
content: '提示的快捷调用',
okProps: {
children: '知道了',
},
onOk: function () { return console.log('ok'); },
onCancel: function () { return console.log('cancel'); },
});
} }, "Notice"),
React.createElement(CnButton, { fullWidth: true, type: "primary", style: { marginBottom: 10 }, onClick: function () {
CnDialog.help({
title: '快捷调用',
content: '帮助的快捷调用',
okProps: {
children: '知道了',
},
onOk: function () { return console.log('ok'); },
onCancel: function () { return console.log('cancel'); },
});
} }, "Help"),
React.createElement(CnButton, { fullWidth: true, type: "primary", style: { marginBottom: 10 }, onClick: function () {
CnDialog.confirm({
title: '普通弹窗',
content: 'Confirm的快捷调用',
});
} }, "Confirm"),
React.createElement(CnButton, { fullWidth: true, type: "primary", style: { marginBottom: 10 }, onClick: function () {
CnDialog.show({
title: '便捷调用',
content: '便捷调用内容',
footerActions: [
'ok',
'cancel',
{
text: '再想想',
onClick: function () { },
},
],
});
} }, "\u5FEB\u6377\u8C03\u7528"))));
};
export default { title: 'demo/CnDialog' };