實作console.qrcode
方法達成在Browser Console顯示QRCode圖片
除了可以直接在console.qrcode
方法中直接帶入文字輸出外,也可以使用qrcodejs中的參數。
declare interface Console {
qrcode(text: string | { //可直接帶入文字,使用預設的設定產生QRCode
text: string,
width: number, //可設定圖片長寬
height: number,
colorDark?: string, //暗色
colorLight?: string, //亮色
correctLevel?: any, //容錯
}): void;
}
- console.image : 用以輸出圖片在Console
- qrcodejs : 產生QRCode圖片