是的,可以在里面添加變量style。在你的情況下%應該在引號內。<tr v-for="task in tasks.data " v-if=" task.projet_id == key " :key="task.id"> <td >{{ parseInt(100 * task.progress) }}% <div class="progress"> <div class="progress-bar bg-success" role="progressbar" aria-valuenow="0" :style=" {'width':`${parseInt(100 * task.progress)}%`}" id="progress" aria-valuemin="`${parseInt(100 * task.progress)}`" aria-valuemax="100"></div> </div> </td>添加樣式時不需要包含;,因為樣式數據是一個對象,并且將commas像這樣分隔:style="{'width':`${parseInt(100 * task.progress)}%`, color:'red'}"期望:“按鈕”一詞應在深藍色背景上以白色顯示。實際:在 Safari 中(僅?!),“按鈕”一詞在深藍色背景上顯示為黑色,難以辨認。這里出了什么問題?這是我的錯嗎?有解決方法嗎?
2 回答

弒天下
TA貢獻1818條經驗 獲得超8個贊
這是 Safari 中的一個已知錯誤。https://bugs.webkit.org/show_bug.cgi?id=158782自 2016 年以來一直開放。
發生這種情況是因為“all: unset”將 -webkit-text-fill-color 設置為黑色,并且覆蓋了顏色。
-webkit-text-fill-color
您可以通過設置所需的顏色來解決這個問題。希望他們有一天能修復這個錯誤!
button {
all: unset;
color: white;
-webkit-text-fill-color: white;
background-color: darkblue;
}
<button>button</button>

互換的青春
TA貢獻1797條經驗 獲得超6個贊
有趣的。將all: unset所有值重置為其繼承值。
如果您想要解決方法,您所需要做的就是將其包裝在帶有白色文本的元素中。下面的代碼片段并不理想,但它應該可以在 Safari 中工作。
button {
all: unset;
background-color: darkblue;
}
.button-wrapper {
color: white;
}
<div class="button-wrapper">
<button>button</button>
</div>
- 2 回答
- 0 關注
- 137 瀏覽
添加回答
舉報
0/150
提交
取消