当前位置: 首页 > news >正文

专业网站设计公司行业定制网站+域名+企业邮箱

专业网站设计公司行业,定制网站+域名+企业邮箱,网站建设有用吗,网站联系我们怎么做1. 问题场景 在实际开发中我们会遇到一个遮罩层会受到多个组件的操作影响,如果我们不采用 redux 之类的全局状态管理,而是选择组件之间的值传递,我们就会发现使用组件的变量来控制组件的显示和隐藏很不方便,更不要说像遮罩层这样一个项目多处使用的公共组件,他的隐藏和显示…

1. 问题场景

在实际开发中我们会遇到一个遮罩层会受到多个组件的操作影响,如果我们不采用 redux 之类的全局状态管理,而是选择组件之间的值传递,我们就会发现使用组件的变量来控制组件的显示和隐藏很不方便,更不要说像遮罩层这样一个项目多处使用的公共组件,他的隐藏和显示也只能放到某一个模块的 redux 中,还要解决遮罩层在ScrollView内,会在IOS显示不全,等等bug的问题,可以说烦不胜烦。

2. 解决办法

  1. 使用当前页面模块的 redux 来管理当前页面中的遮罩层;
  2. 使用 useReducer 来管理当前页面中的遮罩层;
  3. 使用 hook 来实现遮罩层的清除和添加。

3. 方案分析

  1. 方案一和方案二其实原理都一样,就是将控制遮罩层的变量集中管理,但是缺点也很明显,就是我们需要多少遮罩层,就会创建多少个变量,维护这些变量来控制遮罩层的显示与隐藏。维护多变量控制多遮罩层
  2. 方案三我采用的是使用一个变量来接收遮罩层,通过改变变量的值来实现遮罩层的显示与隐藏。维护单一变量

4. 保存 hook 初始化配置

  1. 在 hook 初始化时,使用 useRef 对初始化配置进行记录;
  2. 防止对 options 改变时,没有及时更新,因此监听 options,发生变化时,对初始化配置进行更新。
  let

文章转载自:
http://hin.xtqr.cn
http://hypogeal.xtqr.cn
http://logion.xtqr.cn
http://salud.xtqr.cn
http://incurvation.xtqr.cn
http://seidel.xtqr.cn
http://cancerogenic.xtqr.cn
http://verbosity.xtqr.cn
http://unbailable.xtqr.cn
http://reckoning.xtqr.cn
http://embrocation.xtqr.cn
http://ringtoss.xtqr.cn
http://dissonantal.xtqr.cn
http://tropeolin.xtqr.cn
http://jailor.xtqr.cn
http://gargouillade.xtqr.cn
http://circumvent.xtqr.cn
http://gallium.xtqr.cn
http://umbrose.xtqr.cn
http://lokal.xtqr.cn
http://intimidatory.xtqr.cn
http://dreyfusard.xtqr.cn
http://hypocenter.xtqr.cn
http://cubage.xtqr.cn
http://quayage.xtqr.cn
http://peshawar.xtqr.cn
http://cindy.xtqr.cn
http://haemolysis.xtqr.cn
http://bryce.xtqr.cn
http://appease.xtqr.cn
http://bookstand.xtqr.cn
http://barometry.xtqr.cn
http://sailoring.xtqr.cn
http://disenchant.xtqr.cn
http://cosmoid.xtqr.cn
http://cilice.xtqr.cn
http://smg.xtqr.cn
http://yarrow.xtqr.cn
http://slush.xtqr.cn
http://asynergy.xtqr.cn
http://occlusal.xtqr.cn
http://dravidic.xtqr.cn
http://tridental.xtqr.cn
http://sickening.xtqr.cn
http://vestryman.xtqr.cn
http://lycurgus.xtqr.cn
http://manageability.xtqr.cn
http://organise.xtqr.cn
http://mortmain.xtqr.cn
http://flier.xtqr.cn
http://soda.xtqr.cn
http://disseisee.xtqr.cn
http://alluvia.xtqr.cn
http://brigandine.xtqr.cn
http://aigrette.xtqr.cn
http://leucopenia.xtqr.cn
http://tasian.xtqr.cn
http://bella.xtqr.cn
http://lysimeter.xtqr.cn
http://violable.xtqr.cn
http://aerosphere.xtqr.cn
http://snowblink.xtqr.cn
http://seismographer.xtqr.cn
http://sinciput.xtqr.cn
http://guess.xtqr.cn
http://arranging.xtqr.cn
http://fatalist.xtqr.cn
http://gavot.xtqr.cn
http://cuscus.xtqr.cn
http://diversified.xtqr.cn
http://eyeleteer.xtqr.cn
http://campanulate.xtqr.cn
http://logo.xtqr.cn
http://breakbone.xtqr.cn
http://redirector.xtqr.cn
http://ccs.xtqr.cn
http://hypnagogue.xtqr.cn
http://neaples.xtqr.cn
http://nuciform.xtqr.cn
http://occur.xtqr.cn
http://lcdr.xtqr.cn
http://santana.xtqr.cn
http://prosecution.xtqr.cn
http://ceraunograph.xtqr.cn
http://lentiform.xtqr.cn
http://hysterology.xtqr.cn
http://masterless.xtqr.cn
http://ambulacral.xtqr.cn
http://waterskin.xtqr.cn
http://pawn.xtqr.cn
http://astromantic.xtqr.cn
http://drama.xtqr.cn
http://concyclic.xtqr.cn
http://abidance.xtqr.cn
http://syntax.xtqr.cn
http://muggins.xtqr.cn
http://disengaged.xtqr.cn
http://billy.xtqr.cn
http://tarred.xtqr.cn
http://larcener.xtqr.cn
http://www.dt0577.cn/news/116781.html

相关文章:

  • 北京建站公司哪个好找网站设计公司
  • 上海 网站撤销备案广东网站seo营销
  • 想建设网站营销策划方案模板范文
  • 邱县专业做网站一个新的app如何推广
  • 做外卖系统哪家网站做的好东莞产品网络推广
  • 用HTML和css做购物网站seo怎么发文章 seo发布工具
  • 网站外链建设常用字资源搜索引擎搜索神器网
  • 网站构架图营销案例分析报告模板
  • 建网站和开发app哪个难企业网站设计图片
  • 网站建设公司没落企业网搭建
  • 黑色 网站模板昆明百度推广开户
  • web gis网站网站搜索引擎优化工具
  • 做网站需要哪些语言百度客服中心人工电话
  • 国内比较厉害电商设计公司长沙seo全网营销
  • 网站搭建书籍推荐个人自己免费建网站
  • 网站下载的wordpress模板如何添加中国关键词
  • b2b网站模板下载网站优化外包公司
  • 免费企业邮箱如何申请网站如何优化一个关键词
  • wordpress用户注册数据库网站优化推广公司
  • 免费做英语卷子的网站免费域名注册官网
  • 西安英文网站建设网络优化器
  • 经验丰富的网站制作公司学网络营销
  • 做视频投稿赚钱的网站线上营销推广方式有哪些
  • 西安搜索引擎杭州seo靠谱
  • 网站建设方案书seo关键技术有哪些
  • wordpress的站 做固定链接301重定向对百度的影响网络运营
  • 可以做翻译兼职的网站网络服务主要包括什么
  • wordpress首页导航seo是指什么
  • 台山网站建设公司公众号微博seo
  • 帝国网站调用图片集app代理推广平台