react按需引入antd-mobile
安装antd-mobile
npm i antd-mobile -S
法一
法二
法三
组件使用
import React, { Component } from 'react'
import { Button } from 'antd-mobile';
export default class Index extends Component {
render() {
console.log(process.env.REACT_APP_ENV)
return (
<div>
首页
<Button type="warning" disabled>warning disabled</Button>
</div>
)
}
}
详细看官网
https://mobile.ant.design/docs/react/introduce-cn
https://mobile.ant.design/docs/react/use-with-create-react-app-cn