1

Reactjs 中需要的解决方案我想将任何组件内容下载为具有所有 css 效果的 pdf。需要帮助来完成downloadAsPdf功能

import React from 'react'

function downloadAsPdf(component,filename) {
    // todo download the component as pdf with that specified filename
}

function Table() {
    return (
        <div>
            Ant content that i want to download as pdf
        </div>
    )
}

function App() {
    return (
        <div>
            <button onclick={downloadAsPdf(Table,"id.pdf")}>download table as PDF </button>
            <p> some other work...</p>
        </div>
    )
}
export default App
4

0 回答 0