我想使用我的Reaction应用程序中的.我使用的是原样给出的例子,但我得到了错误.我能够很好地使用列表和输入法.
ERROR in ./src/components/Idea/CommentsCard.js 142:37-44
export 'Comment' (imported as 'Comment') was not found in 'antd' (possible exports: Affix, Alert, Anchor, App, AutoComplete, Avatar, BackTop, Badge, Breadcrumb, Button, Calendar, Card, Carousel, Cascader, Checkbox, Col, Collapse, ConfigProvider, DatePicker, Descriptions, Divider, Drawer, Dropdown, Empty, FloatButton, Form, Grid, Image, Input, InputNumber, Layout, List, Mentions, Menu, Modal, Pagination, Popconfirm, Popover, Progress, QRCode, Radio, Rate, Result, Row, Segmented, Select, Skeleton, Slider, Space, Spin, Statistic, Steps, Switch, Table, Tabs, Tag, TimePicker, Timeline, Tooltip, Tour, Transfer, Tree, TreeSelect, Typography, Upload, Watermark, message, notification, theme, version)
我已经安装了该程序包
npm install antd
import { Avatar, Comment, Input, List, Tooltip } from 'antd';
return (
<List
className="comment-list"
header={`${data.length} replies`}
itemLayout="horizontal"
dataSource={data}
renderItem={item => (
<li>
<Comment
actions={item.actions}
author={item.author}
avatar={ 'https://ui-avatars.com/api/name='+item.author+ '&background=random'}
content={item.content}
datetime={item.datetime}
/>
</li>
)}
/>
);