@alicloud/console-components
Version:
Alibaba Cloud React Components
29 lines (28 loc) • 1.62 kB
JavaScript
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
/**
* title: "带标题以及文字链"
* description: "通过 open 方法唤起提醒, 提醒内容content 支持定制"
*/
var react_1 = __importDefault(require("react"));
var console_components_1 = require("@alicloud/console-components");
var openNotificationWithTitle = function (type, content) {
if (content === void 0) { content = '提醒内容置于页面右上,边距各8px'; }
console_components_1.Notification.open({
title: react_1.default.createElement("span", { style: { fontWeight: 500 } }, "\u6807\u9898"),
content: content,
type: type,
duration: 100000,
});
};
exports.default = (function () {
return (react_1.default.createElement(console_components_1.Button, { type: "primary", onClick: function () {
return openNotificationWithTitle('notice', react_1.default.createElement(react_1.default.Fragment, null,
"\u63D0\u9192\u5185\u5BB9\u7F6E\u4E8E\u9875\u9762\u53F3\u4E0A\uFF0C\u8FB9\u8DDD\u54048px\uFF0C\u5185\u5BB9\u8D85\u957F\u8BF7\u6298\u884C\u663E\u793A\u3002\u63D0\u9192\u5185\u5BB9\u7F6E\u4E8E\u9875\u9762\u53F3\u4E0A\uFF0C\u8FB9\u8DDD\u54048px\uFF0C\u5185\u5BB9\u8D85\u957F\u8BF7\u6298\u884C\u663E\u793A\u3002",
' ',
react_1.default.createElement("a", { href: "/" }, "\u6587\u5B57\u94FE\u63A5")));
} }, "\u5E26\u6807\u9898\u4EE5\u53CA\u6587\u5B57\u94FE"));
});