在 ReactJS 較為初級的使用 antd-mobile 使用時候直接加載 node_modules 文件中的相關 CSS,這個使用方法效率低;更高明的方法則按需加載,需要設置如下:
- 在 package.json 的 babel 配置里的 plugins 項里添加 如下代碼:
[
"import",
{
"libraryName": "antd-mobile",
"style": "css"
}
]
參考: