
1 liiihhhh 2021-11-25 23:50:25 +08:00 我试了一下,貌似 Chrome 主动的为 img 分页. 用`background-image`能实现你想要的效果 https://codesandbox.io/s/laughing-fermat-p18sv?file=/src/components/HelloWorld.vue |
2 Opportunity 2021-11-25 23:51:53 +08:00 `background-image + `-webkit-print-color-adjust: exact;` 吧。。。 page-break-* 的属性只有避免分页的没有强制分页的。。。你的需求太奇怪了,正常来讲应该是在 `.content` 上应用 `page-break-inside: avoid;` |
4 xpyusrs OP @Opportunity 刚试了 page-break-inside: avoid; 实际.content 里面的 item 数量可能多个, 那样会很长, page-break-inside: avoid;的话有些打印出来的纸会留很多空白 |
5 liiihhhh 2021-11-26 09:41:34 +08:00 @xpyusrs https://imgur.com/a/3Ig22UP 打印的时候选中 背景图片选项 |