![](/img/trans.png)
[英]Angular4 <mat-progress-spinner> how to show and hide when a page load completes
[英]How to reverse the progress on mat-progress-spinner
有兩個問題:
1.- 根據值計算以分秒為單位的時間
我喜歡使用 Date 對象和日期管道
get time()
{
return new Date(0,0,0,0,0,900-9*this.value)
}
{{time|date:'mm:ss'}}
2.-使兩個div居中,你可以使用,例如
.box {
display: flex;
align-items: center;
justify-content: center;
}
.box div {
width: 100px;
height: 100px;
}
.div2
{
z-index:100;
position:absolute;
display: flex;
align-items: center;
justify-content: center;
}
還有你的 .html
<div class="box">
<mat-progress-spinner
class="example-margin"
color="primary"
mode="determinate"
[value]="value">
</mat-progress-spinner>
<div class="div2">{{time|date:'mm:ss'}}</div>
</div>
在 Material 將其作為指令實現之前,您可以使用一些 CSS 來欺騙我認為這是最好和最簡單的解決方案。
水平翻轉(在你的情況下):
mat-progress-spinner {
-moz-transform: scale(-1, 1);
-webkit-transform: scale(-1, 1);
-o-transform: scale(-1, 1);
-ms-transform: scale(-1, 1);
transform: scale(-1, 1);
}
垂直翻轉:
mat-progress-spinner {
-moz-transform: scale(1, -1);
-webkit-transform: scale(1, -1);
-o-transform: scale(1, -1);
-ms-transform: scale(1, -1);
transform: scale(1, -1);
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.