taro 创建 Tabbar
1.代码
src/app.js
import '@tarojs/async-await'
import Taro, { Component } from '@tarojs/taro'
import Home from './pages/home'
import dva from './utils/dva'
import models from './models'
import { Provider } from '@tarojs/redux' import './styles/base.scss' const dvaApp = dva.createApp({
initialState: {},
models: models,
});
const store = dvaApp.getStore(); class App extends Component { config = {
pages: [
'pages/home/index',
'pages/cart/index',
'pages/user/index',
],
window: {
backgroundTextStyle: 'dark',
navigationBarBackgroundColor: '#fff',
navigationBarTitleText: '女装租赁平台',
navigationBarTextStyle: 'black'
},
tabBar: {
list: [{
pagePath: "pages/home/index",
text: "首页",
iconPath: "./images/tab/home.png",
selectedIconPath: "./images/tab/home-active.png"
}, {
pagePath: "pages/cart/index",
text: "衣袋",
iconPath: "./images/tab/cart.png",
selectedIconPath: "./images/tab/cart-active.png"
},{
pagePath: "pages/user/index",
text: "我的",
iconPath: "./images/tab/user.png",
selectedIconPath: "./images/tab/user-active.png"
}],
color: '#333',
selectedColor: '#333',
backgroundColor: '#fff',
borderStyle: '#ccc'
}
} componentDidMount() { } render() {
return (<Provider store={store}>
<Home/>
</Provider>);
}
} Taro.render(<App/>, document.getElementById('app'))
2.项目目录
3.效果图
taro 创建 Tabbar的更多相关文章
- Xcode中不用Storyboard,用纯xib创建TabBar模式视图
大熊猫猪·侯佩原创或翻译作品.欢迎转载,转载请注明出处. 如果觉得写的不好请多提意见,如果觉得不错请多多支持点赞.谢谢! hopy ;) 如果要开发Tab类型视图的App,在Xcode中可以使用对应的 ...
- 创建TabBar
-(void)creatTabBarView { NSArray *imgArray=@[]; NSArray *selectImage=@[]; NSArray *names=@[]; for (i ...
- 使用 react-native-tab-navigator 创建 TabBar 组件
1.首先安装好ReactNative的运行环境,安装组件依赖库 使用npm install react-native-tab-navigator --save安装所依赖的第三方库 2.导入 impor ...
- 关于修改tabbar的颜色的问题
首先,项目是在故事板中搭建的,所以遇到这个问题的时候,首先是想到在故事板中找到相关的属性,确实是有一个Selected Image,但是设置了这个图片以后,运行的效果是,点击选择后,本身的image就 ...
- TabBar自定义方式(一)
1.思路:创建一个继承UIView的TabBar类,并将需要的item添加到TabBar上面去,并用代理来处理相应的时间 [self.view bringSubviewToFront:self.one ...
- 51.从首页内容跳转到第二个Tabbar控制器(controller)
TabBarController: 创建TabBar的控制器 注意:在点击的内容方法页面,添加头文件 #import "TabBarController.h" #import &q ...
- UI-自定义TabBar
MyCustomTabBar.h文件 #import <UIKit/UIKit.h> @interface MyCustomTabBar : UITabBarController @end ...
- 微信小程序项目开发实战:用WePY、mpvue、Taro打造高效的小程序》(笔记4)支持React.js语法的Taro框架
Taro本身实现的情况类似于mpvue,mpvue的未来展望中也包含了支付宝小程序,现在的版本中,也可以使用不同的构建命令来构建出百度小程序的支持,如第10章所示,但是现在Taro先于mpvue实现了 ...
- 【Flutter学习】基本组件之TabBar顶部导航
一,概述 TabBar,是材料设计(Material design)中很常用的一种横向标签页.在Android原生开发中,我们常用ViewPage或者一些常用的标签页开源库,来实现并行界面的横向滑动展 ...
随机推荐
- Mysql远程连接报错:SQL Error (1130): Host '192.168.6.128' is not allowed to connect to this MySQL server
通过SQLyog连接linux中的MySQL报错问题:SQL Error (1130): Host '192.168.6.128' is not allowed to connect to this ...
- Flask实战第47天:首页导航条首先和代码抽离
新建一个前台页面的父模板front_base.html 导航条是总boostrap v3中文站拷贝过来的,然后根据自己的需求做一些修改 <!DOCTYPE html> <html l ...
- RabbitMQ (八) 队列的参数详解
代码中,我们通常这样声明一个队列: //声明队列 channel.QueueDeclare ( queue: QueueName, //队列名称 durable: false, //队列是否持久化.f ...
- Xamarin.Forms教程下载安装Xamarin.iOS
Xamarin.Forms教程下载安装Xamarin.iOS 下载安装Xamarin.iOS Xamarin.iOS可以为Mac上iOS应用程序在Windows计算机上编写和测试网络提供构建和部署服务 ...
- VB查询数据库之终极篇——机房收费系统总结(七)
机房收费系统总结系列到此就算是要结束了.在做机房收费系统之前,做了学生管理系统,可以说,对机房收费系统的帮助很大. 在机房收费系统中,数据库的查询,数据写入数据库,更改数据库内的信息等一些操作在学生信 ...
- [BZOJ1913][APIO2010]信号覆盖(计算几何+计数)
1913: [Apio2010]signaling 信号覆盖 Time Limit: 20 Sec Memory Limit: 64 MBSubmit: 1658 Solved: 672[Subm ...
- BZOJ 3544 [ONTAK2010]Creative Accounting(set)
[题目链接] http://www.lydsy.com/JudgeOnline/problem.php?id=3544 [题目大意] 找一段区间使得Σai mod m的值最大. [题解] 首先计算前缀 ...
- 20162312实验四Java Android简易开发
实验准备 Android Studio 的下载: Android Studio 安装教程 准备中遇到的问题 最大的问题就是电脑无法虚拟化,因为微星的型号太多,我只好在网上找了许多方案一个个试,最后终于 ...
- Codeforces Beta Round #3 D. Least Cost Bracket Sequence 优先队列
D. Least Cost Bracket Sequence 题目连接: http://www.codeforces.com/contest/3/problem/D Description This ...
- 8VC Venture Cup 2016 - Elimination Round E. Simple Skewness 暴力+二分
E. Simple Skewness 题目连接: http://www.codeforces.com/contest/626/problem/E Description Define the simp ...