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 that adding styles in vue components does not take effect?

2025-04-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

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

This article mainly introduces the vue component to add a style does not take effect on how to solve the relevant knowledge, the content is detailed and easy to understand, simple and fast operation, with a certain reference value, I believe that after reading this vue component to add a style does not take effect how to solve the article will have a harvest, let's take a look at it.

The specific scenarios are as follows

/ vue component / / I use js to insert a text goes here in the above div tag

Export default {... Mounted () {$('.box') .html ('text goes here

')},...} / / style, vue component scoped style adds the data-v-*** attribute / / style to the end of the selector and adds scoped .box {color:red;} .text {color:blue;}

The browser renders html and style as follows:

/ / html text goes here

/ / style.box [data-v-33f8ed40] {color:red;} .text [data-v-33f8ed40] {/ / style does not take effect, because there is no attribute data-v-33f8ed40color:blue;} in the p tag. This is the end of the article on "how to solve the problem that adding styles in vue components does not work". Thank you for reading! I believe that everyone has a certain understanding of the knowledge of "how to solve the problem if adding styles in vue components does not take effect". If you want to learn more knowledge, 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

Internet Technology

Wechat

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

12
Report