Warm tip: This article is reproduced from stackoverflow.com, please click
css vue.js printing styles

Vue print page with original styles

发布于 2020-03-31 22:58:24

I have application and I want to have print button that print my page, but with original style from css. Already I have button that evoke function window.print(). Also i have print.scss with styles

    @media print {
     header {display:none;}
     footer {display:none;}
     button {visibility: hidden;}
    }  

Problem is that I want to have original styles from my styles files (there are many).

original style

print version

(I cut off buttons on purpose.)

Questioner
Michał Kruk
Viewed
32
Michał Kruk 2020-01-31 19:54

Okey I found solution, it was just no background colors attached. In media query for print I just added this: -webkit-print-color-adjust: exact !important;