Giter Club home page Giter Club logo

taro-demo's Introduction

Taro-demo

github上能找到的taro适配Android、iOS、微信小程序、H5最佳实践,主要涉及到了基础网络请求的封装、适配了多端的SafeArea安全区域、style工具样式引用替换scss的繁琐写法大幅度简化代码,同时解决了scss样式无法通过className进行属性传递的问题、自定义tabBar、全局模态对话框展示(解决了微信小程序端不能覆盖底部tabBar的问题)、展示了相同组件多端适配引用的方式、多端样式布局通过styleAssign注入flex、column、relative的方式实现统一化、演示了app的消息通信,通过mock数据在本地搭建服务进行前后端分离开发、本脚手架各端适配的比较完美适合用来进行全新项目的多端开发,后续基础组件持续完善中,目标是打造一个多端共用的基础组件库.

适配进度

  • H5 -- 完美适配
  • React Native -- 完美适配
  • 微信小程序 -- 完美适配

目标功能

  • 打造一个多端共用的基础组件库 -- 持续开发完善中

样式转化

 .home__search__top {
  display: flex;
  flex-direction: row;
  align-items: center;
  background: white;
  margin-left: 20px;
  margin-right: 20px;
 }

将上述scss写法替换为以下写法,简化布局代码,同时解决了scss样式无法通过className进行属性传递的问题

style={styleAssign([styles.udr,styles.uac,bgColor('white'),ml(20),mr(20)]}

技术栈

typescript+eslint+redux+taro+react-native+mock

用法

直接clone本项目进入项目根目录执行npm install操作,然后将third_changes对应目录里面的修改项替换项目根目录node_modules里面对应的组件,react-native原生端壳子Taro-demo-rn-shell. 更多官方组件使用请移步京东Taro官方文档微信小程序官方文档

  • 先打开本地mock服务命令:npm run mock
  • rn端运行命令:npm run dev:rm
  • h5端运行命令:npm run dev:h5
  • 微信小程序端运行命令:npm run dev:weapp

多端适配效果图

效果图1

效果图1

效果图1

效果图1

使用Taro开发的线上小程序:BusinessCard

基于闲鱼fish-redux架构的Flutter项目脚手架fish-redux-demo

taro-demo's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

taro-demo's Issues

报 Taro CLI 版本错误

错误 版本问题 Taro CLI 与本地安装运行时框架 @tarojs/taro-weapp 版本不一致, 请确保版本一致!

image

[email protected]: This module has moved

npm install 出错了,跑不起来啊

PS D:\Taro-demo> npm install
npm WARN deprecated [email protected]: This module has moved and is now available at @rollup/plugin-alias. Please update your dependencies. This version is no longer maintained.
Unhandled rejection Error: ENOSPC: no space left on device, [email protected] checking installable status

Unhandled rejection Error: ENOSPC: no space left on device, [email protected] checking installable status

npm ERR! cb() never called!

npm ERR! This is an error with npm itself. Please report this error at:
npm ERR! https://npm.community

微信小程序上面,底部下面四个导航栏没有居中

1、微信小程序上面,底部下面四个导航栏没有居中
2、VM30:1 thirdScriptError
o.__props.onPress is not a function; [Component] Event Handler Error @ compoments/touchable-button/index#(anonymous)
TypeError: o.__props.onPress is not a function

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.