1. 程式人生 > >react-native使用螞蟻金服的antd-mobile元件庫教程

react-native使用螞蟻金服的antd-mobile元件庫教程

國際慣例,先來展示下這個強大的組建庫,常用的大部分組建都可以找到


9A99D507-9505-478F-956C-8F243CFECAF5.png
3D408F99-BCD5-4C3E-905B-0EDAEB58A858.png
FFC8CB54-EF30-41AB-AA49-83AE3379C69E.png
A52EFACE-86F2-4586-86F5-6644206FDD4D.png

安裝步驟

1.

 npm install react-dom --save

2.

npm install antd-mobile --save

3.

npm install babel-plugin
-import --save-dev

4.在你的專案目錄下找到。.babelrc 檔案,把括號裡面的內容( "plugins": [["import", { "libraryName": "antd-mobile" }]],)配置好

{
  "plugins": [["import", { "libraryName": "antd-mobile" }]],
  "presets": ["react-native"]
}

使用步驟
1.引入

import { Button } from 'antd-mobile';

2.使用

render() {
    return <Button>
Start</Button>
; }

親測,超級好用所以分享給大家。。。。。