UNPKG

@cainiaofe/cn-ui-m

Version:
25 lines (24 loc) 1.21 kB
import { __assign } from "tslib"; import React, { useState } from 'react'; import { CnButton, CnDemoPage, CnWaterMark, CnBox } from "../../.."; var textProps = { content: 'CN UI Mobile', }; var imageProps = { image: 'https://gw.alicdn.com/imgextra/i2/O1CN01zUTpAt267GOj8VHj7_!!6000000007614-2-tps-591-356.png', imageWidth: 115, imageHeight: 70, width: 180, height: 100, }; export var 文字和图片水印 = function () { var _a = useState(textProps), waterOtions = _a[0], setWaterOptions = _a[1]; return (React.createElement("div", { style: { padding: '12px' } }, React.createElement(CnDemoPage, { title: "\u6587\u5B57\u548C\u56FE\u7247\u6C34\u5370" }, React.createElement(CnBox, { direction: "row", spacing: 12 }, React.createElement(CnButton, { onClick: function () { return setWaterOptions(textProps); } }, "\u6587\u5B57\u6C34\u5370"), "\u00A0\u00A0\u00A0", React.createElement(CnButton, { onClick: function () { return setWaterOptions(imageProps); } }, "\u56FE\u7247\u6C34\u5370")), React.createElement(CnWaterMark, __assign({}, waterOtions))))); }; export default { title: 'demo/CnWatermark' };