UNPKG

@cainiaofe/cn-ui-m

Version:
36 lines (35 loc) 1.54 kB
import { __assign } from "tslib"; import { CnDemoBlock as DemoBlock, CnSlider, CnSliderItem, CnDemoPage, } from "../../.."; import React from 'react'; var colors = ['#ace0ff', '#bcffbd', '#e4fabd', 'blue']; var contentStyle = { height: '120px', color: '#fff', display: 'flex', justifyContent: 'center', alignItems: 'center', fontSize: '48px', userSelect: 'none', }; var verticalContentStyle = { height: '100%', color: '#fff', display: 'flex', justifyContent: 'center', alignItems: 'center', fontSize: '48px', userSelect: 'none', }; var items = colors.map(function (color, index) { return (React.createElement(CnSliderItem, { key: index }, React.createElement("div", { style: __assign(__assign({}, contentStyle), { background: color }), onClick: function () { console.log("\u4F60\u70B9\u51FB\u4E86\u5361\u7247 ".concat(index + 1)); } }, index + 1))); }); // eslint-disable-next-line @typescript-eslint/no-unused-vars var verticalItems = colors.map(function (color, index) { return (React.createElement(CnSliderItem, { key: index }, React.createElement("div", { style: __assign(__assign({}, verticalContentStyle), { background: color }) }, index + 1))); }); export var 箭头 = function () { return (React.createElement(CnDemoPage, { title: "\u7BAD\u5934" }, React.createElement(DemoBlock, { title: "\u7BAD\u5934" }, React.createElement(CnSlider, { loop: true, showArrow: true }, items)))); }; export default { title: 'demo/CnSlider' };