@cainiaofe/cn-ui-m
Version:
24 lines (23 loc) • 1.06 kB
JavaScript
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 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))); });
export var 自动播放 = function () {
return (React.createElement(CnDemoPage, { title: "\u81EA\u52A8\u64AD\u653E" },
React.createElement(DemoBlock, { title: "\u81EA\u52A8\u64AD\u653E" },
React.createElement(CnSlider, { autoplay: true }, items))));
};
export default { title: 'demo/CnSlider' };