i use typescript in vue and use document.fonts api but console this log
Property 'fonts' does not exist on type 'Document'
Experimental APIs aren't in the lib file.
You can fix it with: (document as any).fonts
For me and according to this thread, was enough to install the following package:
npm i -S @types/css-font-loading-module
And then on the .ts file where you see the error, import the next line:
import type { } from "css-font-loading-module";
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With