crabbly / Print.js

A tiny javascript library to help printing from the web.
MIT License
4.28k stars 672 forks source link

打印时如何设置自定义布局 #703

Open WeijianLi-dve opened 6 months ago

WeijianLi-dve commented 6 months ago
image

在点击打印的时候我希望实现右侧的 审批记录 区域的内容会排列到表单内容的最下面,而不是默认的左右结构。请问该如何实现

表单内容

import Print from "print-js"; printClick() { let params = { printable: "printFrom", header: "申请表", ignore: ["no-print"], }; Print({ printable: params.printable, // 'printFrom', // 标签元素id type: params.type || "html", header: params.header, // '表单', targetStyles: ["*"], style: .sidebar { position: absolute; bottom: 0; left: 0; right: 0; width: 100%; }, // 可选-打印时去掉眉页眉尾 ignoreElements: params.ignore || [], // ['no-print'] properties: params.properties || null, }); } 最终想要的效果:

image