@alicloud/console-components
Version:
Alibaba Cloud React Components
30 lines (29 loc) • 1.55 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
/**
* title: "语意(以默认信息条状态为例)"
* description: "通过 type 属性设置信息条状态"
*/
var react_1 = __importDefault(require("react"));
var console_components_1 = require("@alicloud/console-components");
var openNotification = function (type, content) {
if (content === void 0) { content = '提醒内容置于页面右上,边距各8px'; }
console_components_1.Notification.open({
content: content,
type: type,
duration: 100000,
});
};
exports.default = (function () {
return (react_1.default.createElement(react_1.default.Fragment, null,
react_1.default.createElement(console_components_1.Button, { type: "primary", onClick: function () { return openNotification('notice'); } }, "\u9AD8\u4EAE"),
"\u00A0",
react_1.default.createElement(console_components_1.Button, { type: "primary", onClick: function () { return openNotification('success'); } }, "\u6210\u529F"),
"\u00A0",
react_1.default.createElement(console_components_1.Button, { type: "primary", onClick: function () { return openNotification('warning'); } }, "\u4F4E\u5371"),
"\u00A0",
react_1.default.createElement(console_components_1.Button, { type: "primary", onClick: function () { return openNotification('error'); } }, "\u9AD8\u5371")));
});