您的位置:首页 > Web前端 > React

react native中引入antd-mobile

2018-01-30 17:01 369 查看
1.安装
antd-mobile
babel-plugin-import


yarn add antd-mobile react-dom
yarn add --dev babel-plugin-import


2.编辑 .babelrc

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


3.使用

import React, { Component } from 'react';
import { AppRegistry } from 'react-native';
import { Button } from 'antd-mobile';

class HelloWorldApp extends Component {
render() {
return <Button>Start</Button>;
}
}

AppRegistry.registerComponent('HelloWorldApp', () => HelloWorldApp);
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: