problem description
the plug-in found on the Internet is called print-js, and then keeps reporting errors according to the example, (0, _ printJs2.default) is not a function
the environmental background of the problems and what methods you have tried
I printed the discovery that it was an empty object, not a method, and never figured out what went wrong
related codes
/ / Please paste the code text below (do not replace the code with pictures)
plug-in underlying encapsulation: 1. Index.js
(import print from". / js/init"
const printjs = print.init
if (typeof window! = = "undefined") {
window.printJS = printjs
})
II. Init.js
(export default {
init () {
let params = {
printable: null,
fallbackPrintable: null,
export default printjs
III. My citation method
import print from "print-js"
print({
printable: "print_count",
type: "html",
//
targetStyles: ["*"]
})
documentation of the plug-in: http://printjs.crabbly.com/-sharpcdn
II,