My goal is to update the 'background-image' when the page is accessed.
export default {
created () {
document.getElementsByTagName('html')[0].style.background = "url('../assets/background-blur.png') center"
}
} //Login.vue
The file structure looks like this:
src
└assets
└background-blur.png
└views
└Login.vue
When using colors instead of images, it works as expected. For example:
export default {
created () {
document.getElementsByTagName('html')[0].style.background = 'blue'
}
} //Login.vue
I am facing a challenge in finding a solution to this issue.