How to solve the problem of non-compilation of style background setting in vue template
This article mainly introduces the vue template style background setting does not compile how to solve the relevant knowledge, the content is detailed and easy to understand, the operation is simple and fast, has a certain reference value, I believe that after reading this vue template style background setting non-compilation problem how to solve the article will have a harvest, let's take a look.
Style background settings in template are not compiled
Among the components defined by vue, the background cannot be displayed by directly setting the inline style, and the path characters such as @ set in config.resolve.alias cannot be recognized.
Solution method
Parse the image resource in the data of vue and then bind it to the page
/ / data defines the scope where the component needs to return data guarantee data in the function data: function () {return {weatherData: {}, img: require ('@ assets/image/sunny_n.jpg')}}, and how to add background to template components. Index _ background {background: url ('@ /.. / static/images/login-bg.png') center top no-repeat } this is the end of the article on "how to solve the problem of non-compilation of style background settings in vue template". Thank you for reading! I believe you all have a certain understanding of the knowledge of "how to solve the problem of non-compilation of style background settings in vue template". If you want to learn more, you are welcome to follow the industry information channel.