似乎无法使用 Print.js 进行打印,当我单击“打印”时没有任何显示

Cant seem to get printing to work using Print.js, nothing appears when i click print

我刚开始使用http://printjs.crabbly.com/#documentation

阅读文档后,它似乎没有给我打印机预览 window 当我点击打印时,非常有趣的是它似乎没有给我任何 js 错误chrome 上的控制台。请看下面:

     <button type="button" onclick("printJS('JobSheet','html')")>Print Job 
     Sheet</button>
<link rel="stylesheet" href="{{asset('bundles/css/print.min.css')}}">
<script src="{{asset('bundles/js/print.min.js')}}"></script>

如有任何提示,我们将不胜感激。

有任何错误吗?检查一下我的 simple 片段并与 yours.please 进行比较,确保你引用了正确的 printjs 文件和关于 id

<p id="myElementId">Hello {{name}}!</p>
    <button type="button" onclick="printJS('myElementId', 'html')">tryprint</button>