当前位置:网站首页 > Vue.js开发 > 正文

js关于if-else的逻辑使用优化

初始方案

if(this.objValue!==""){ this.modify(); this.viewer.clock.currentTime = this.viewer.clock.startTime;//归位至起始位置 this.viewer.clock.shouldAnimate = true;//运动 this.viewer.entities.removeAll(); this.move(); }else{ this.viewer.clock.currentTime = this.viewer.clock.startTime; this.viewer.clock.shouldAnimate = true; this.viewer.entities.removeAll(); this.move(); } 

优化后

start(){ if(this.objValue!==""){ this.modify(); } this.viewer.clock.currentTime = this.viewer.clock.startTime; this.viewer.clock.shouldAnimate = true; this.viewer.entities.removeAll(); this.move(); }, 

 

到此这篇js关于if-else的逻辑使用优化的文章就介绍到这了,更多相关内容请继续浏览下面的相关推荐文章,希望大家都能在编程的领域有一番成就!

版权声明


相关文章:

  • VUE的生命周期2024-11-30 10:09:09
  • 在vue项目中引入使用ElementUI2024-11-30 10:09:09
  • VUE引入工具类2024-11-30 10:09:09
  • vue组件中的this指向问题2024-11-30 10:09:09
  • JS跳出循环的遍历方法2024-11-30 10:09:09
  • 资源网365,资源之家! 天天好资源!力争打造一个更好的资源网下载站.希望大家指教!...2024-11-30 10:09:09
  • map变成json(map变成一个新单词)2024-11-30 10:09:09
  • vue2和vue3有啥区别(vue2和vue3的兼容)2024-11-30 10:09:09
  • vuejs反编译(vue.js反编译)2024-11-30 10:09:09
  • spss27授权码分享(spss22.0授权码)2024-11-30 10:09:09
  • 全屏图片