Skip to content

Commit 24e61b3

Browse files
author
ex_likx5
committed
asyncUrl 新增vue对象回传
1 parent e27a70c commit 24e61b3

File tree

10 files changed

+16
-13
lines changed

10 files changed

+16
-13
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ export default {
292292
data() {
293293
return {
294294
printObj: {
295-
asyncUrl (reslove) {
295+
asyncUrl (reslove, vue) {
296296
setTimeout(() => {
297297
reslove('http://localhost:8080/')
298298
}, 2000)
@@ -333,7 +333,7 @@ Finally, use `reslove()` to return your URL
333333
| closeCallback | Close the callback function of printing tool success | Function | Returns the instance of `Vue` called at that time | - |
334334
| beforeOpenCallback | Callback function before calling printing tool | Function | Returns the instance of `Vue` called at that time | - |
335335
| url | Print the specified URL. (It is not allowed to set the ID at the same time) | string | - | - |
336-
| asyncUrl | Return URL through 'resolve()' | Function | - | - |
336+
| asyncUrl | Return URL through 'resolve()' and Vue | Function | - | - |
337337
| preview | Preview tool | Boolean | - | false |
338338
| previewTitle | Preview tool Title | String | - | '打印预览' |
339339
| previewPrintBtnLabel | The name of the preview tool button | String | - | '打印' |

lib/print.common.js

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/print.common.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/print.umd.js

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/print.umd.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/print.umd.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/print.umd.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue-print-nb",
3-
"version": "1.7.0",
3+
"version": "1.7.1",
44
"description": "Vue plug-in, print! Good!",
55
"main": "lib/print.umd.min.js",
66
"author": "Power-kxLee",

print/packages/print.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* @Author: lee
33
* @Date: 2021-05-10 11:45:50
44
* @LastEditors: lee
5-
* @LastEditTime: 2021-05-12 17:59:55
5+
* @LastEditTime: 2021-05-14 10:13:41
66
* @Description: file content
77
*/
88
import Print from './printarea.js';
@@ -38,6 +38,7 @@ export default {
3838
const localPrint = () => {
3939
new Print({
4040
ids: id, // * 局部打印必传入id
41+
vue,
4142
url: binding.value.url, // 打印指定的网址,这里不能跟id共存 如果共存id的优先级会比较高
4243
standard: '', // 文档类型,默认是html5,可选 html5,loose,strict
4344
extraHead: binding.value.extraHead, // 附加在head标签上的额外标签,使用逗号分隔

print/packages/printarea.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export default class {
3737
// 直接打印
3838
_this.print(PrintAreaWindow);
3939
}
40-
})
40+
}, _this.settings.vue)
4141
return
4242
}
4343
let PrintAreaWindow = this.getPrintWindow(url); // 创建iframe

0 commit comments

Comments
 (0)