Code Monkey home page Code Monkey logo

document-editor-vue's People

Contributors

aleksandrfedorov97 avatar dependabot[bot] avatar kseniafedoruk avatar linneys avatar ovchinnikova-natalya avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

document-editor-vue's Issues

Error occure "this.api.asc_OnSaveEnd is not a function"

I want to save file with the js code, so I use next method:

editor.processSaveResult(true, 'Your document has been saved.');

but, it occure error. the document server log show this

[2023-07-30T06:20:57.754] [ERROR] [localhost] [862f4ea9442147168bdfa5a07d14dfc9] [22] nodeJS - clientLog: changesError: Error: Uncaught TypeError: this.api.asc_OnSaveEnd is not a function
 Script: http://office.k8s-test.clps.com.cn/7.4.0-163/web-apps/apps/spreadsheeteditor/main/app.js
 Line: 8:2463672
 userAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36
 platform: Win32
 isLoadFullApi: true
 isDocumentLoadComplete: true
 performance.memory: {"totalJSHeapSize":217741268,"usedJSHeapSize":204639936,"jsHeapSizeLimit":4294705152}
 StackTrace: TypeError: this.api.asc_OnSaveEnd is not a function
    at i.onProcessSaveResult (http://office.k8s-test.clps.com.cn/7.4.0-163/web-apps/apps/spreadsheeteditor/main/app.js:8:2463672)
    at D (http://office.k8s-test.clps.com.cn/7.4.0-163/web-apps/apps/spreadsheeteditor/main/app.js:8:97744)
    at Object.<anonymous> (http://office.k8s-test.clps.com.cn/7.4.0-163/web-apps/apps/spreadsheeteditor/main/app.js:8:97948)
    at Object.<anonymous> (http://office.k8s-test.clps.com.cn/7.4.0-163/web-apps/apps/spreadsheeteditor/main/app.js:8:91123)
    at Object.<anonymous> (http://office.k8s-test.clps.com.cn/7.4.0-163/web-apps/apps/spreadsheeteditor/main/app.js:8:177672)
    at Object.dispatch (http://office.k8s-test.clps.com.cn/7.4.0-163/web-apps/apps/spreadsheeteditor/main/app.js:8:43421)
    at b.handle (http://office.k8s-test.clps.com.cn/7.4.0-163/web-apps/apps/spreadsheeteditor/main/app.js:8:41416)
    at Object.trigger (http://office.k8s-test.clps.com.cn/7.4.0-163/web-apps/apps/spreadsheeteditor/main/app.js:8:71941)
    at Object.<anonymous> (http://office.k8s-test.clps.com.cn/7.4.0-163/web-apps/apps/spreadsheeteditor/main/app.js:8:72537)
    at Function.each (http://office.k8s-test.clps.com.cn/7.4.0-163/web-apps/apps/spreadsheeteditor/main/app.js:8:2978)
<template>
  <DocumentEditor
	id="docEditor"
	:config="config"
	:documentServerUrl="serverUrl"
	:events_on-app-ready="appReady"
	height="1020px"
  />
</template>

<script setup>
import {defineExpose, defineProps, onMounted, ref} from 'vue';
import {DocumentEditor} from "@onlyoffice/document-editor-vue";
import pageApi from '../../assets/api/page.js'

const serverUrl = import.meta.env.VITE_OFFICE_SERVER + "";

const props = defineProps({
  content: {
	type: String,
	required: true,
	default: '',
  }
});
let content;
let config;
let editor;
if (props.content) {
  content = JSON.parse(props.content);
  config = ref(content);
}
let appReady = (docEditor) => {
  editor = docEditor
}
let save = () => {
  editor.processSaveResult(true, 'Your document has been saved.');
}
onMounted(() => {
  if (!content) {
	return
  }
  pageApi.getOfficeToken(content).then((token) => {
	config.value.token = token.data
  });
});
defineExpose({save});
</script>

the moule version is 1.3.0
how can i fix it, hope help from somebody!

Can not load new file

I changed config props. But the document can not be changed.

Changed:

// example
{
  url: '',
  callback: ''
}

The document title have been changed, But content is old.

APi, 如何获取

var connector = docEditor.createConnector()
connector.callCommand(function() {

var oDocument = Api.GetDocument();
var oParagraph = Api.CreateParagraph();
oParagraph.AddText(Asc.scope.text);
oDocument.InsertContent([oParagraph]);

}, function() { console.log("callback command"); });

is there a version for vue 2?

Hello dear:
I tried this package in my old project,which is built with vue2.it Throwed an error, I found that this package is vue3 only, so,i'd like to ask for a version of vue2,is there any help?or how can I get more information for it?thanks.

how should i use the history event

there are no method with name refreshHistory and setHistoryData in the vueEditor, but Official document say must use refreshHistory before onRequestHistory and setHistoryData before onRequestHistoryData

api.js load error is not emit

  let url = this.documentServerUrl;
    if (!url!.endsWith("/")) url += "/";

    const docApiUrl = `${url}web-apps/apps/api/documents/api.js`;
    loadScript(docApiUrl, "onlyoffice-api-script")
      .then(() => this.onLoad())
      .catch((err) => console.error(err)); // here
  },

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.