@js-preview/docx
Advanced tools
Comparing version 0.0.3 to 0.0.4
@@ -101,2 +101,4 @@ import { renderAsync } from 'docx-preview'; | ||
_defineProperty(this, "container", null); | ||
_defineProperty(this, "wrapper", null); | ||
_defineProperty(this, "wrapperMain", null); | ||
_defineProperty(this, "options", {}); | ||
@@ -107,4 +109,19 @@ _defineProperty(this, "requestOptions", {}); | ||
this.requestOptions = requestOptions; | ||
this.createWrapper(); | ||
} | ||
_createClass(JsDocxPreview, [{ | ||
key: "createWrapper", | ||
value: function createWrapper() { | ||
this.wrapper = document.createElement('div'); | ||
this.wrapper.className = 'vue-office-docx'; | ||
this.wrapperMain = document.createElement('div'); | ||
this.wrapperMain.className = 'vue-office-docx-main'; | ||
this.wrapper.appendChild(this.wrapperMain); | ||
this.container.appendChild(this.wrapper); | ||
} | ||
// <div className="vue-office-docx"> | ||
// <div className="vue-office-docx-main" ref="rootRef"></div> | ||
// </div> | ||
}, { | ||
key: "setOptions", | ||
@@ -125,10 +142,10 @@ value: function setOptions(options) { | ||
docx.getData(src, _this.requestOptions).then(function (res) { | ||
docx.render(res, _this.container, _this.options).then(function () { | ||
docx.render(res, _this.wrapperMain, _this.options).then(function () { | ||
resolve(); | ||
})["catch"](function (e) { | ||
docx.render('', _this.container, _this.options); | ||
docx.render('', _this.wrapperMain, _this.options); | ||
reject(e); | ||
}); | ||
})["catch"](function (err) { | ||
docx.render('', _this.container, _this.options); | ||
docx.render('', _this.wrapperMain, _this.options); | ||
reject(err); | ||
@@ -135,0 +152,0 @@ }); |
@@ -105,2 +105,4 @@ (function (global, factory) { | ||
_defineProperty(this, "container", null); | ||
_defineProperty(this, "wrapper", null); | ||
_defineProperty(this, "wrapperMain", null); | ||
_defineProperty(this, "options", {}); | ||
@@ -111,4 +113,19 @@ _defineProperty(this, "requestOptions", {}); | ||
this.requestOptions = requestOptions; | ||
this.createWrapper(); | ||
} | ||
_createClass(JsDocxPreview, [{ | ||
key: "createWrapper", | ||
value: function createWrapper() { | ||
this.wrapper = document.createElement('div'); | ||
this.wrapper.className = 'vue-office-docx'; | ||
this.wrapperMain = document.createElement('div'); | ||
this.wrapperMain.className = 'vue-office-docx-main'; | ||
this.wrapper.appendChild(this.wrapperMain); | ||
this.container.appendChild(this.wrapper); | ||
} | ||
// <div className="vue-office-docx"> | ||
// <div className="vue-office-docx-main" ref="rootRef"></div> | ||
// </div> | ||
}, { | ||
key: "setOptions", | ||
@@ -129,10 +146,10 @@ value: function setOptions(options) { | ||
docx.getData(src, _this.requestOptions).then(function (res) { | ||
docx.render(res, _this.container, _this.options).then(function () { | ||
docx.render(res, _this.wrapperMain, _this.options).then(function () { | ||
resolve(); | ||
})["catch"](function (e) { | ||
docx.render('', _this.container, _this.options); | ||
docx.render('', _this.wrapperMain, _this.options); | ||
reject(e); | ||
}); | ||
})["catch"](function (err) { | ||
docx.render('', _this.container, _this.options); | ||
docx.render('', _this.wrapperMain, _this.options); | ||
reject(err); | ||
@@ -139,0 +156,0 @@ }); |
{ | ||
"name": "@js-preview/docx", | ||
"type" :"module", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"description": "", | ||
@@ -6,0 +6,0 @@ "main": "lib/index.js", |
15955
321