From 685c002bd6709377d8144f715bb5c4d97f4bd55e Mon Sep 17 00:00:00 2001 From: liyulin <501351981@qq.com> Date: Fri, 27 Oct 2023 15:58:01 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A7=A3=E5=86=B3=E4=B9=BE=E5=9D=A4?= =?UTF-8?q?=E4=B8=ADdocx=E7=A9=BA=E7=99=BD=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/package.json | 2 ++ core/packages/js-docx/package.json | 2 +- core/packages/js-docx/src/hack.js | 7 +++++++ core/packages/js-docx/src/main.js | 1 + core/packages/vue-docx/index.js | 1 + core/packages/vue-docx/package.json | 2 +- core/packages/vue-docx/src/hack.js | 8 ++++++++ 7 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 core/packages/js-docx/src/hack.js create mode 100644 core/packages/vue-docx/src/hack.js diff --git a/core/package.json b/core/package.json index ab20494..a7e002f 100644 --- a/core/package.json +++ b/core/package.json @@ -7,7 +7,9 @@ "build": "node script/bak-vue.js && vite build", "lib": "node script/bak-vue.js bak && lerna run build", "lib:js-excel": "node script/bak-vue.js bak && lerna run build --scope @js-preview/excel", + "lib:js-docx": "node script/bak-vue.js bak && lerna run build --scope @js-preview/docx", "lib:vue-excel": "node script/bak-vue.js bak && lerna run build --scope @vue-office/excel", + "lib:vue-docx": "node script/bak-vue.js bak && lerna run build --scope @vue-office/docx", "lib:js-pdf": "node script/bak-vue.js bak && lerna run build --scope @js-preview/pdf", "lib:vue-pdf": "node script/bak-vue.js bak && lerna run build --scope @vue-office/pdf" }, diff --git a/core/packages/js-docx/package.json b/core/packages/js-docx/package.json index db3c255..7ceeb1c 100644 --- a/core/packages/js-docx/package.json +++ b/core/packages/js-docx/package.json @@ -1,7 +1,7 @@ { "name": "@js-preview/docx", "type" :"module", - "version": "1.3.0", + "version": "1.3.1", "description": "", "main": "lib/index.js", "files": [ diff --git a/core/packages/js-docx/src/hack.js b/core/packages/js-docx/src/hack.js new file mode 100644 index 0000000..e9584d4 --- /dev/null +++ b/core/packages/js-docx/src/hack.js @@ -0,0 +1,7 @@ +if(typeof window.setImmediate === 'undefined' ){ + window.setImmediate = function (func, ...args){ + setTimeout(()=>func(args)); + }; +} + +export default {} \ No newline at end of file diff --git a/core/packages/js-docx/src/main.js b/core/packages/js-docx/src/main.js index 1b82950..24eb970 100644 --- a/core/packages/js-docx/src/main.js +++ b/core/packages/js-docx/src/main.js @@ -1,3 +1,4 @@ +import hack from './hack.js'; import docx from '../../vue-docx/src/docx'; import {download as downloadFile} from '../../../utils/url.js'; class JsDocxPreview { diff --git a/core/packages/vue-docx/index.js b/core/packages/vue-docx/index.js index 9480e86..341829c 100644 --- a/core/packages/vue-docx/index.js +++ b/core/packages/vue-docx/index.js @@ -1,3 +1,4 @@ +import hack from './src/hack'; import VueOfficeDocx from './src/main.vue'; VueOfficeDocx.install = function (Vue) { diff --git a/core/packages/vue-docx/package.json b/core/packages/vue-docx/package.json index 2293db9..b1e3f52 100644 --- a/core/packages/vue-docx/package.json +++ b/core/packages/vue-docx/package.json @@ -1,6 +1,6 @@ { "name": "@vue-office/docx", - "version": "1.3.0", + "version": "1.3.1", "description": "", "main": "lib/index.js", "files": [ diff --git a/core/packages/vue-docx/src/hack.js b/core/packages/vue-docx/src/hack.js new file mode 100644 index 0000000..45517c3 --- /dev/null +++ b/core/packages/vue-docx/src/hack.js @@ -0,0 +1,8 @@ +//乾坤下不能渲染问题兼容 +if(typeof window.setImmediate === 'undefined' ){ + window.setImmediate = function (func, ...args){ + setTimeout(()=>func(args)); + }; +} + +export default {} \ No newline at end of file