0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

印刷プレビューの注意点

Posted at

印刷プレビューの表示の仕方について

印刷時の表示しない範囲は以下のように設定しなければ基本、ページ全体が表示されます。

<style>
@media print {
  .クラス名 {
    display: none;
  }
}

</style>

最近、Vueのページにトーストのメッセージを実装したところ
1度も使用しなければ問題ないのだが、1度でも使用するとトーストを使用して非表示になった後にも以下のタグがページの下に残ってしまう

これが原因になって空白の1ページがプレビューに追加されるバグが発生してしまう可能性があります。

トーストの作成方法のURL

<div class="v-toast v-toast--top"></div>
<div class="v-toast v-toast--bottom"></div>

トーストを印刷プレビューから排除する

Vue.jsのトーストを印刷プレビューから排除するスタイル

<style>
@media print {
  .v-toast {
    display: none !important;
  }
}

</style>

上記のスタイルを指定しておくとトーストを印刷プレビューから排除できました

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?