antdesign官网代码怎么在intellijIDEA中直接使用?还是说要改一些东西,能举一个例子吗?

发布于 2022-09-12 13:47:47 字数 2138 浏览 12 评论 0

题目描述

antdesign官网代码怎么在intellijIDEA中直接使用?还是说要改一些东西,能举一个例子吗?任意一个例子都行。

题目来源及自己的思路

小白,刚开始接触,求大佬搭救
例如button代码,要改东西才能用吗?

相关代码

粘贴代码文本(请勿用截图)

import { Button, Radio } from 'antd';
import { DownloadOutlined } from '@ant-design/icons';

class ButtonSize extends React.Component {
state = {

size: 'large',

};

handleSizeChange = e => {

this.setState({ size: e.target.value });

};

render() {

const { size } = this.state;
return (
  <>
    <Radio.Group value={size} onChange={this.handleSizeChange}>
      <Radio.Button value="large">Large</Radio.Button>
      <Radio.Button value="default">Default</Radio.Button>
      <Radio.Button value="small">Small</Radio.Button>
    </Radio.Group>
    <br />
    <br />
    <Button type="primary" size={size}>
      Primary
    </Button>
    <Button size={size}>Default</Button>
    <Button type="dashed" size={size}>
      Dashed
    </Button>
    <br />
    <Button type="link" size={size}>
      Link
    </Button>
    <br />
    <Button type="primary" icon={<DownloadOutlined />} size={size} />
    <Button type="primary" shape="circle" icon={<DownloadOutlined />} size={size} />
    <Button type="primary" shape="round" icon={<DownloadOutlined />} size={size} />
    <Button type="primary" shape="round" icon={<DownloadOutlined />} size={size}>
      Download
    </Button>
    <Button type="primary" icon={<DownloadOutlined />} size={size}>
      Download
    </Button>
  </>
);

}
}

ReactDOM.render(<ButtonSize />, mountNode);

你期待的结果是什么?实际看到的错误信息又是什么?

复制粘贴之后用umi dev运行会报错
To install it, you can run: npm install --save @ant-design/icons

使用npm install --save @ant-design/icons

会报错78 packages are looking for funding
run npm fund for details
是因为我的环境配置缺少什么东西吗?还是必须要改代码才能用?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

注定孤独终老 2022-09-19 13:47:47

跟着antd的快速上手来了吗?

心是晴朗的。 2022-09-19 13:47:47

你知道 react 吗?

回首观望 2022-09-19 13:47:47

会用了,麻烦各位了

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文