react-native 使用 antd-mobile-rn UI进行开发app
生活随笔
收集整理的這篇文章主要介紹了
react-native 使用 antd-mobile-rn UI进行开发app
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
1、創(chuàng)建 react-native 項目
react-native init app032、安裝組件
npm install antd-mobile-rn --save3、配置按需加載
npm install babel-plugin-import --save-dev// .babelrc 文件中增加下面代碼 "plugins": [["import",{"libraryName": "antd-mobile-rn"}] ]4、使用 antd-mobile-rn 組件進行開發(fā)
App.js
import React, {Component} from 'react';// 導(dǎo)入組件 import { Button } from 'antd-mobile-rn';type Props = {}; export default class App extends Component<Props> {render() {return (<View style={styles.container}>// 使用組件<Button type='primary'>按鈕</Button></View> );} }const styles = StyleSheet.create({container: {flex: 1,justifyContent: 'center',alignItems: 'center',backgroundColor: '#F5FCFF',} });?
展示效果:
?
轉(zhuǎn)載于:https://www.cnblogs.com/CongZhang/p/9908396.html
總結(jié)
以上是生活随笔為你收集整理的react-native 使用 antd-mobile-rn UI进行开发app的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Oracle数据库锁诊断
- 下一篇: Apollo分布式配置中心部署以及使用