Я поднял сервер
https://github.com/ONLYOFFICE/Docker-DocumentServer
Сервер работает и доступен по localhost
но на консоли редактора выходит:
"Document security key is not correctly formed. Please contact your document server administrator"
Я переподнял его c -e JWT_ENABLED=false
теперь выходит:
The document could not be saved. Please check connection settings or contact your administrator.
When you click the 'OK' button, you will be prompted to download the document.
Document failed
Вот мой vue компонент:
<template>
<DocumentEditor
id="docEditor"
documentServerUrl="http://localhost/"
:config="config"
:events_onDocumentReady="onDocumentReady"
:onLoadComponentError="onLoadComponentError"
/>
</template>
<script lang="ts">
import { defineComponent } from "vue";
import { DocumentEditor } from "@onlyoffice/document-editor-vue";
export default defineComponent({
name: "ExampleComponent",
components: {
DocumentEditor,
},
data() {
return {
config: {
document: {
fileType: "docx",
key: "Khirz6zTPdfd7",
title: "Example Document Title.docx",
url: "https://example.com/url-to-example-document.docx",
},
documentType: "word",
editorConfig: {
callbackUrl: "https://example.com/url-to-callback.ashx",
},
},
};
},
methods: {
onDocumentReady() {
console.log("Document is loaded");
},
onLoadComponentError(errorCode, errorDescription) {
switch (errorCode) {
case -1: // Unknown error loading component
console.log(errorDescription);
break;
case -2: // Error load DocsAPI from http://documentserver/
console.log(errorDescription);
break;
case -3: // DocsAPI is not defined
console.log(errorDescription);
break;
}
},
},
});
</script>