Skip to content

Commit 2377cab

Browse files
author
Guillaume Chau
committed
Fix toast background color not updated
1 parent 78b747f commit 2377cab

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/backend/toast.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@ export function installToast (window) {
99
}
1010

1111
window.__VUE_DEVTOOLS_TOAST = (message, type) => {
12-
console.log(`%c vue-devtools %c ${message} %c `, 'background:#35495e ; padding: 1px; border-radius: 3px 0 0 3px; color: #fff', `background: ${colors[type] || colors.normal}; padding: 1px; border-radius: 0 3px 3px 0; color: #fff`, 'background:transparent')
12+
const color = colors[type] || colors.normal
13+
console.log(`%c vue-devtools %c ${message} %c `,
14+
'background:#35495e ; padding: 1px; border-radius: 3px 0 0 3px; color: #fff',
15+
`background: ${color}; padding: 1px; border-radius: 0 3px 3px 0; color: #fff`,
16+
'background:transparent')
1317
if (!toastEl) {
1418
toastEl = document.createElement('div')
1519
toastEl.addEventListener('click', removeToast)
@@ -27,9 +31,9 @@ export function installToast (window) {
2731
font-family: monospace;
2832
font-size: 14px;
2933
">
30-
<div style="
34+
<div class="vue-wrapper" style="
3135
padding: 6px 12px;
32-
background: ${colors[type] || colors.normal};
36+
background: ${color};
3337
color: white;
3438
border-radius: 3px;
3539
flex: auto 0 0;
@@ -41,6 +45,8 @@ export function installToast (window) {
4145
</div>
4246
`
4347
document.body.appendChild(toastEl)
48+
} else {
49+
toastEl.querySelector('.vue-wrapper').style.background = color
4450
}
4551

4652
toastEl.querySelector('.vue-content').innerText = message

0 commit comments

Comments
 (0)