✨ 当api背景没加载出来显示默认背景图
This commit is contained in:
BIN
resources/state/img/default_bg.jpg
Normal file
BIN
resources/state/img/default_bg.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.4 MiB |
@@ -30,6 +30,7 @@
|
||||
}
|
||||
|
||||
.container {
|
||||
background-image: url("./img/default_bg.jpg");
|
||||
background-color: #e9e9e9;
|
||||
background-position: center top;
|
||||
background-repeat: no-repeat;
|
||||
|
||||
@@ -108,7 +108,11 @@
|
||||
// 背景api
|
||||
if (backdrop) {
|
||||
var container = document.getElementById('container')
|
||||
container.style.backgroundImage = 'url(' + backdrop + ')'
|
||||
const img = new Image();
|
||||
img.onload = function () {
|
||||
container.style.backgroundImage = 'url(' + backdrop + ')';
|
||||
}
|
||||
img.src = backdrop;
|
||||
}
|
||||
const by = (value) => {
|
||||
value = value?.value ?? value
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
|
||||
.container {
|
||||
background: {
|
||||
image: url('./img/default_bg.jpg');
|
||||
color: #e9e9e9;
|
||||
position: center top;
|
||||
repeat: no-repeat;
|
||||
|
||||
Reference in New Issue
Block a user