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:

    1. <template>
    2. <DocumentEditor
    3. id="docEditor"
    4. documentServerUrl="http://documentserver/"
    5. :config="config"
    6. :events_onDocumentReady="onDocumentReady"
    7. />
    8. </template>
    9. <script lang="ts">
    10. import { defineComponent } from 'vue';
    11. import { DocumentEditor } from "@onlyoffice/document-editor-vue";
    12. export default defineComponent({
    13. components: {
    14. DocumentEditor
    15. },
    16. data() {
    17. return {
    18. config: {
    19. document: {
    20. fileType: "docx",
    21. key: "Khirz6zTPdfd7",
    22. title: "Example Document Title.docx",
    23. url: "https://example.com/url-to-example-document.docx"
    24. },
    25. documentType: "word",
    26. editorConfig: {
    27. }
    28. }
    29. },
    30. methods: {
    31. onDocumentReady() {
    32. console.log("Document is loaded");
    33. }
    34. },
    35. });
    36. </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:

    1. 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.

    2. Build Storybook with the following command:

      1. npm run build-storybook
    3. Start Storybook:

      1. npm run storybook
    1. Install the project dependencies:

      1. npm install
    2. Test the component:

    3. 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.