xh-htmlword 1.1.3 → 1.1.5

Sign up to get free protection for your applications and to get access to all the features.
package/index.d.ts CHANGED
@@ -3,12 +3,28 @@
3
3
  * @name xuhao-htmlword
4
4
  *
5
5
  */
6
- export default function handleExportWord({
7
- dom: string,
8
- fileName: string,
9
- timeOut: number,
10
- callback: Function,
11
- options: Object,
12
- defultImg: string,
13
- className: string,
14
- }): void;
6
+
7
+ /**
8
+ * @params
9
+ * dom:需要渲染的html父盒子标签 , 类型:string 例如 id/class
10
+ * fileName:文件名称 类型:string
11
+ * callBack:导出成功回调函数
12
+ * timeOut:设置导出图片加载 超时时间 默认值 5000 (5s)
13
+ * options:配置项 类型:object 例如可传 {left:1440,right:1440} 控制页边距
14
+ * defultImg: 错误或者超时图片 默认图片地址 类型:string
15
+ * className:当前组件的class属性名标识 类型:string 可以在标签写入class样式
16
+ * drawCanvas:当当前页面有比较复杂的样式或组件(element-ui等) 页面中可以用样式标签将它包裹起来然后将标签 传入drawCanvas数组中 开启转换
17
+ */
18
+
19
+ interface IOptions {
20
+ dom: string;
21
+ fileName: string;
22
+ timeOut?: number;
23
+ callback?: Function;
24
+ options?: Object;
25
+ defultImg?: string;
26
+ className?: string;
27
+ drawCanvas?: string[];
28
+ }
29
+
30
+ export default function handleExportWord(options: IOptions): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xh-htmlword",
3
- "version": "1.1.3",
3
+ "version": "1.1.5",
4
4
  "type": "module",
5
5
  "description": "用于html页转word文档的工具",
6
6
  "files": [
@@ -16,10 +16,11 @@
16
16
  "require": "./dist/counter.umd.cjs"
17
17
  },
18
18
  "scripts": {
19
- "dev": "vite",
19
+ "dev": "vite --open",
20
20
  "build": "vite build"
21
21
  },
22
22
  "devDependencies": {
23
+ "sass": "^1.75.0",
23
24
  "vite": "^5.0.10"
24
25
  },
25
26
  "keywords": [
@@ -29,6 +30,10 @@
29
30
  "author": "xuhao",
30
31
  "license": "ISC",
31
32
  "dependencies": {
32
- "file-saver": "^2.0.5"
33
+ "@vitejs/plugin-vue": "^5.0.4",
34
+ "element-plus": "^2.7.0",
35
+ "file-saver": "^2.0.5",
36
+ "html2canvas": "^1.4.1",
37
+ "vue": "^3.4.23"
33
38
  }
34
39
  }