Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
4.2k views
in Technique[技术] by (71.8m points)

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

题目描述

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
是因为我的环境配置缺少什么东西吗?还是必须要改代码才能用?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...