You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
And in Home.vue, I want to bind a variable bgImgUrl to the background-image
where const bgImgUrl = `url('../assets/wallpaper/${title}.png')`
I tried background-image: v-bind(bgImgUrl), but the image is not rendered.
However If I just use background-image: url('../assets/wallpaper/default.png'), this works, but it will not be variable.
I am really confused, by the way the inline binding doesn't work either. I think the problem lies the entanglement of three things: url(), v-bind() and the url resolution specificity of vitepress, and I really don't know how to deal with them.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have a assets of images
And in Home.vue, I want to bind a variable
bgImgUrlto thebackground-imagewhere const bgImgUrl = `url('../assets/wallpaper/${title}.png')`
I tried
background-image: v-bind(bgImgUrl), but the image is not rendered.However If I just use
background-image: url('../assets/wallpaper/default.png'), this works, but it will not be variable.I am really confused, by the way the inline binding doesn't work either.
I think the problem lies the entanglement of three things: url(), v-bind() and the url resolution specificity of vitepress, and I really don't know how to deal with them.
Beta Was this translation helpful? Give feedback.
All reactions