vue-html-to-paper
vue-html-to-paper copied to clipboard
Typescript support
close #12
Not compatible for #28 #29 now, but it's easy to do.
@jofftiquez OK, I fixed it.
@jofftiquez Are these PRs going to be merged in any time soon? They're all a good bump in this package's usability.
@jofftiquez is there a chance that you still merge this PR? Would be awesome!
Hi @thecoconutdream @Hawxy I'm just waiting for the PR author to fix the conflicts otherwise I'll implement it myself. Just a few more days.Thank you for reminding me.
@jofftiquez Hey, thanks for the reply :) Any news?
@jofftiquez sorry for delay, I can certainly fix the conflict if it still needed.
Too many files changed but not mentioned in this PR and it is not easy to review, I can reopen a PR to facilitate review if needed.
Hi @nsznsznjsz @jofftiquez :) Any updates when the merge will happen? :)
Sorry about the super late reply, @yzx9. Any chance you can update the PR for the latest version? Thanks
Sorry about the super late reply, @yzx9. Any chance you can update the PR for the latest version? Thanks
Yes, I would still like to update. I'll push an update later.
I forced push an update to make this PR clear again.
Type definition was defined in types/index.d.ts
, and enabled by types
field in package.json
.
The current code is for Vue3, if you want to support the Vue2, please change the following code:
import { Plugin } from "vue"
declare module "vue" {
interface ComponentCustomProperties {
$htmlToPaper: HtmlToPaper
}
}
to
import { PluginFunction } from "vue"
declare module "vue/types/vue" {
interface Vue {
$htmlToPaper: HtmlToPaper
}
}
Or add a dependency vue-demi
, and declare both module.
BTW, I added files
field to reduce user install size, more info available at: https://docs.npmjs.com/cli/v9/configuring-npm/package-json#files
I forced push an update to make this PR clear again.
Type definition was defined in
types/index.d.ts
, and enabled bytypes
field inpackage.json
.The current code is for Vue3, if you want to support the Vue2, please change the following code:
import { Plugin } from "vue"
declare module "vue" { interface ComponentCustomProperties { $htmlToPaper: HtmlToPaper } }
to
import { PluginFunction } from "vue"
declare module "vue/types/vue" { interface Vue { $htmlToPaper: HtmlToPaper } }
Or add a dependency
vue-demi
, and declare both module.BTW, I added
files
field to reduce user install size, more info available at: docs.npmjs.com/cli/v9/configuring-npm/package-json#files
IDK if there's still need to add this to vue 2 version but feel free to make a PR to https://github.com/mycurelabs/vue-html-to-paper/tree/v1. Thank you so much for this.