UNPKG

simple-react-ui

Version:

a simple react component library written in TypeScript+ React.js

44 lines 1.69 kB
"use strict"; var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); Object.defineProperty(exports, "__esModule", { value: true }); var React = require("react"); /** * Carousel 的分项 Item */ var Item = /** @class */ (function (_super) { __extends(Item, _super); function Item() { return _super !== null && _super.apply(this, arguments) || this; } Item.prototype.render = function () { return (React.createElement("div", { className: "item " + (this.props.active ? "active" : "") + " ", style: { width: '100%', height: '100%', } }, React.createElement("a", { href: this.props.href }, React.createElement("img", { src: this.props.imgSrc, alt: this.props.imgAlt, style: { width: '100%', height: '100%', } }), React.createElement("div", { className: "carousel-caption" }, this.props.caption)))); }; Item.defaultProps = { href: '#', imgSrc: "#", imgAlt: "#", caption: "#", active: false, }; return Item; }(React.Component)); exports.Item = Item; ; exports.default = Item; //# sourceMappingURL=item.js.map