How to set the background color for a separate page in Vue-cli
Jun 06, 2018 am 10:25 AMBelow I will share with you an implementation method of setting the background color for a separate page in Vue-cli. It has a good reference value and I hope it will be helpful to everyone.
Example:
<template> <p class="finish-wrap"> <p class="finish-header"> <p class="finish-img"> </p> </p> <p class="finish-tip"> 支付成功 </p> <p class="finish-footer"> <router-link to="/">学车所需资料</router-link> <span> <router-link to="/">学车考照流程</router-link> </span> </p> </p> </template>
1. If you set the background-color of the body directly in css, it will cause the background color of other pages to change accordingly. , so it is not advisable;
2. As in the above example, if you set the background color and height of .finish-wrap to 100%, you will find that only a part of the background color is changed, but the background color of the entire screen cannot be changed. ;
Reason: Open app.vue, you will see
<template> <p> <router-view></router-view> </p> </template>
The reason is that there is another layer of p here, so what you change is not The background color of the outermost p, but you cannot modify it here, so:
Solution:
We need to make .finish- Wrap is separated from the document flow and adds a fixed attribute to it. The final result is:
.finish-wrap background-color rgb(255,255,255) height: 100% position: fixed width: 100%
The above is what I compiled for everyone. I hope it will be helpful to everyone in the future.
Related articles:
How to implement the password display and hide switching function in vue
Interpret this.$ in detail in vue.js How to use emit
#How to use the modifier .self in vue.js?
The above is the detailed content of How to set the background color for a separate page in Vue-cli. For more information, please follow other related articles on the PHP Chinese website!

Hot Article

Hot tools Tags

Hot Article

Hot Article Tags

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

How to set the scheduled time for publishing works on Douyin? How does it set the video duration?

Where is the Douyin tag set? How can it be tagged so that it can be pushed accurately?

Setting up Chinese with VSCode: The Complete Guide

How to set the watermark in the middle on Weibo_How to set the watermark in the middle on Weibo

Do Not Disturb Mode Not Working in iPhone: Fix

Where to set Douyin recommendations and selections

How to set up scheduled publishing on Weibo_Tutorial on how to set up scheduled publishing on Weibo

How to set the countdown to grab tickets in Damai
