mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-07-01 18:52:20 +08:00
fix: history block add print button, click print button to report error (#3900)
This commit is contained in:
parent
ea5565b571
commit
a60aa65da6
@ -1,10 +1,11 @@
|
||||
import { useDetailsBlockContext } from '@nocobase/client';
|
||||
import { useDetailsBlockContext, useFormBlockContext } from '@nocobase/client';
|
||||
import { useReactToPrint } from 'react-to-print';
|
||||
|
||||
export const useDetailPrintActionProps = () => {
|
||||
const context = useFormBlockContext();
|
||||
const { formBlockRef } = useDetailsBlockContext();
|
||||
const printHandler = useReactToPrint({
|
||||
content: () => formBlockRef.current,
|
||||
content: () => context?.formBlockRef?.current || formBlockRef?.current,
|
||||
pageStyle: `@media print {
|
||||
* {
|
||||
margin: 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user