Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to solve the problem of non-compilation of style background setting in vue template

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)05/31 Report--

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.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report