博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
taro 创建 Tabbar
阅读量:7105 次
发布时间:2019-06-28

本文共 1482 字,大约阅读时间需要 4 分钟。

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 (
); }}Taro.render(
, document.getElementById('app'))

2.项目目录

3.效果图

转载于:https://www.cnblogs.com/crazycode2/p/9880253.html

你可能感兴趣的文章
WPF:Animation动画--KeyFramesExample帧动画(2)
查看>>
FFMPEG vaapi_encoder 源码阅读
查看>>
h5实现移动端图片预览器(一)
查看>>
支付-收款
查看>>
vue项目打包后想发布在apache www/vue 目录下
查看>>
MixPHP 独特的SQL构建方式
查看>>
PHP简洁之道
查看>>
丁香园开源接口管理系统
查看>>
Burpsuite学习(3)
查看>>
一个Visual Studio Code编辑场景
查看>>
WordPress版微信小程序开发系列(一):WordPress REST API
查看>>
用gomock进行mock测试
查看>>
我的面试准备过程--ubuntu使用过程记录
查看>>
[LeetCode] Remove Element
查看>>
快速了解小程序
查看>>
MongoDB干货篇之数据更新
查看>>
CSS - 纯css实现多行文本溢出省略(兼容所有浏览器)
查看>>
ConcurrentHashMap源码分析_JDK1.8版本
查看>>
Maven 工程实践
查看>>
竹翎(Material风格的APP,附源码)
查看>>