Commit e36a7523 by zhanghou

提交docx-view插件展示文档

parent b0ca9b52
......@@ -496,6 +496,7 @@
</template>
</el-dialog>
</template>
<div ref="file"></div>
</div>
</template>
<script>
......@@ -503,6 +504,7 @@ import commonProcess from "~/mixin/commonProcess";
import Api from "~/service/Api";
import Utils from "~/utils/index";
import DocUtils from "~/utils/DocUtils";
let docx = require("docx-preview");
export default {
inject: ['root'],
props: ['model', 'codes'],
......@@ -655,6 +657,7 @@ export default {
u8arr[length] = bstr.charCodeAt(length); // 返回在指定的位置的字符的 Unicode 编码
}
let blob = new Blob([u8arr]);
docx.renderAsync(blob, this.$refs.file);
let hrefUrl = window.URL.createObjectURL(blob);
let a = document.createElement('a');
a.href = hrefUrl;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment