react-native 使用 antd-mobile-rn UI进行开发app
2024-08-30 01:18:56
1、创建 react-native 项目
react-native init app03
2、安装组件
npm install antd-mobile-rn --save
3、配置按需加载
npm install babel-plugin-import --save-dev // .babelrc 文件中增加下面代码
"plugins": [
[
"import",
{
"libraryName": "antd-mobile-rn"
}
]
]
4、使用 antd-mobile-rn 组件进行开发
App.js
import React, {Component} from 'react'; // 导入组件
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',
}
});
展示效果:
最新文章
- 项目游戏开发日记 No.0x000005
- rpc框架之 avro 学习 2 - 高效的序列化
- 浅谈VB.Net 程序的编译和动态编译
- I/O流——File类及使用
- Xcode 升级成Xcode 8 版本以后,出现 Signing for ";sqlite3--test"; requires a development team. 问题的解决
- 工作随笔——mysql子查询删除原表数据
- 使用spring cloud实现分布式配置管理
- HDU 4419 Colourful Rectangle(线段树+扫描线)
- Redis Cluster 3.0搭建与使用
- Java开发中经典的小实例-(if(参数){}else{})
- 那传说中的P、NP以及NPC问题
- 查看linux系统的版本
- ajax.js
- fedora 设置命令别名
- 解决新版Emacs的警告:Warning (initialization): Your load-path...
- LeetCode第[15]题(Java):3Sum 标签:Array
- php使用file_get_contents请求微信接口失败
- 用UE4蓝图制作FPS_零基础学虚幻4第二季
- bootstrap-table 使用遇到的问题总结
- json 删除、添加对象