- 首先打开antd-mobile的官方文档
- 在项目中安装antd-mobile 使用
npm install antd-mobile yarn add antd-mobile
- 在项目中App.js文件中导入要使用的组件
import {Button} from 'antd-mobile' 使用组件直接在组件中进行使用即可 import { Button } from 'antd-mobile' function App() { return ( <div className="App"> 1223<Button type="warning"/> </div> ); }
- 在index.js中导入组件库样式
import 'antd-mobile/dist/antd-mobile.css'
完成之后,你就能在自己的react项目使用antd-mobile的样式文件进行构建自己的页面了
在react中使用antd-mobile
最新推荐文章于 2024-06-08 09:34:52 发布