Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
413 views
in Technique[技术] by (71.8m points)

实现根据后台传值显示对应的样式

目前想实现根据后台传过来的值,修改对应的进度条,不知道如何实现,等大佬们帮助
想用angularjs写
代码如下:

 <dd class="project-people">
  {{p.__c679.statusName}}
    </dd>
 <div class="progress progress-striped active m-b-sm">
 <div id="progress" style="width: 20%;" class="progress-bar">
   </div>
   </div>    

dd中为我从后台取到的值,是一个字符串,
假设这个字符串有三个状态 : 生成中/出货中/已完成,
想将进度条更改为: 20%/60%/100%

求求了


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
<dd class="project-people">
  {{p.__c679.statusName}}
    </dd>
 <div class="progress progress-striped active m-b-sm">
 <div id="progress" :style="{width: mapStatus[p.__c679.statusName]}"
   </div>
   </div>    
   
   mapStatus = {
    生成中: 20%,
    出货中: 60%,
    已完成: 100%
   }

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...