一、通过项目模版创建一个react项目
set NPM_CONFIG_REGISTRY=https://registry.npmmirror.com
pnpm create vite antd-demo
cd antd-demo
pnpm install
pnpm install antd --save
打开项目:
修改:welcome.tsx
import React from 'react';
import { Button } from 'antd';
export function Welcome() {
return (
<div className="App">
<Button type="primary">Button</Button>
</div>
);
}
运行: