yh-hiprint 2.6.22 → 2.6.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.ts +4 -4
- package/package.json +1 -1
package/index.ts
CHANGED
|
@@ -198,8 +198,6 @@ interface InstallOptions {
|
|
|
198
198
|
router?: Router | undefined;
|
|
199
199
|
pinia?: any;
|
|
200
200
|
isAdmin?: boolean;
|
|
201
|
-
isNew?: boolean;
|
|
202
|
-
addInitTask: (cl:any) => void
|
|
203
201
|
}
|
|
204
202
|
|
|
205
203
|
// 客户端打印处理函数
|
|
@@ -495,12 +493,13 @@ const serverPrint = (code, params) => {
|
|
|
495
493
|
export default {
|
|
496
494
|
install(
|
|
497
495
|
app: any,
|
|
498
|
-
|
|
496
|
+
config: InstallOptions & {clientPrint?: boolean}
|
|
499
497
|
): void {
|
|
500
498
|
app.provide('$hiprint', hiprintFun);
|
|
501
499
|
app.provide('$silentHiprint', silentHiprint);
|
|
502
|
-
|
|
500
|
+
const isNew = app.config.globalProperties.$isNew;
|
|
503
501
|
if(isNew) {
|
|
502
|
+
const {$addInitTask:addInitTask,$router:router} = app.config.globalProperties
|
|
504
503
|
app.provide("$serverPrint",serverPrint)
|
|
505
504
|
addInitTask(async () => {
|
|
506
505
|
if (!router || !router.hasRoute('Index')) return;
|
|
@@ -524,6 +523,7 @@ export default {
|
|
|
524
523
|
});
|
|
525
524
|
})
|
|
526
525
|
} else {
|
|
526
|
+
const {router} = config
|
|
527
527
|
if (router) {
|
|
528
528
|
router.addRoute('Index', {
|
|
529
529
|
path: 'hiprint/designer',
|