css - How come the styles referenced locally in vue become global?
代言
代言 2017-07-06 10:35:40
0
4
1841

1.How can the local styles referenced in vue also take effect on other pages? After the router switches the page, it loads the style of the changed page

代言
代言

reply all(4)
我想大声告诉你

Partial styles can only be applied locally. If you need to use them globally, you can put the public class into app.vue

女神的闺蜜爱上我

In vue, there is the general component app.vue. In this file, the commands you want to promote to the global level can be seen in other operating components. This is the advantage of the declarative framework of vue. In a main The methods or styles defined in the component can be bound to other components

ringa_lee

It just writes the css in a local file, which does not mean that the css only acts locally. If you want it to work only within the component, you can add scoped

<style scoped>
/*css code*/
</style>
phpcn_u1582

Two ways

  • Control the scope of the tag selector yourself

  • Add scoped to style in the component template.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template