ONLYOFFICE Docs Vue component
Install ONLYOFFICE Docs Vue component from npm in your project. Run:
or
Using ONLYOFFICE Docs Vue component
Find below the component usage example:
<template>
<DocumentEditor
id="docEditor"
documentServerUrl="http://documentserver/"
:config="config"
:events_onDocumentReady="onDocumentReady"
/>
</template>
<script lang="ts">
import { defineComponent } from 'vue';
import { DocumentEditor } from "@onlyoffice/document-editor-vue";
export default defineComponent({
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: {
}
}
},
methods: {
onDocumentReady() {
console.log("Document is loaded");
}
},
});
</script>
where the example.com is the name of the server where document manager and document storage service are installed and the documentserver is the name of the server with ONLYOFFICE Docs installed.
Properties
Installing Storybook
Install Storybook to develop UI components in isolation:
Change the address of the document server in the config/default.json file:
where the documentserver is the name of the server with ONLYOFFICE Docs installed.
Build Storybook with the following command:
npm run build-storybook
Start Storybook:
npm run storybook
Install the project dependencies:
npm install
Test the component:
Build the project:
Feedback and support
In case you have any issues, questions, or suggestions for the ONLYOFFICE Docs Vue component, please refer to the section.