@alicloud/console-components
Version:
Alibaba Cloud React Components
27 lines (26 loc) • 1.21 kB
JavaScript
;
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 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(console_components_1.Button, { type: "primary", onClick: function () {
return openNotification('notice', react_1.default.createElement(react_1.default.Fragment, null,
"\u8FD0\u8425\u7C7B\u4FE1\u606F\u6216\u63D0\u793A\u7C7B\u4FE1\u606F ",
react_1.default.createElement("a", { href: "/" }, "\u6587\u5B57\u94FE\u63A5")));
} }, "\u5E26\u6587\u5B57\u94FE\u63A5"));
});