Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting error when I change page in version 4.6.2 #164

Closed
salekin02 opened this issue Feb 13, 2025 · 1 comment
Closed

Getting error when I change page in version 4.6.2 #164

salekin02 opened this issue Feb 13, 2025 · 1 comment

Comments

@salekin02
Copy link

salekin02 commented Feb 13, 2025

new version doesn't have pagination feature. If I need header and footer, I must use version 4.x. But there are the error shows. version 4.6.2

umo-editor.js:21732 Uncaught (in promise) TypeError: Cannot read properties of null (reading 'getElementById') at SU (umo-editor.js:21732:103) at watch.deep (umo-editor.js:22949:59)

Jt.getElementById("computeddiv");

I checked the page elements and found no element with id "computeddiv"

source code:

<template>
  <umo-editor
    ref="editorRef"
    v-bind="options"
    @changed:page-size="onChangedPageSize"
    @save="onSave">
    <template #page_header="props">
       <div style="height: 500px" v-html="header" />
    </template>
  </umo-editor>
</template>
 


<script setup>
import { ref } from 'vue';
import { UmoEditor } from '@umoteam/editor';

// Define the props
const props = defineProps({
  header: {
    type: String,
    default: ''
  },
  backgroundImageUrl: {
    type: String,
    default: ''
  },
  onSave: {
    type: Function,
    default: () => {}
  }
});

const editorRef = ref(null);
const options = ref({
  defaultMode: 'ribbon',
  locale: 'en-US',
});

const onChangedPageSize = (size) => {
  console.log('onChangedPageSize', size);
};

</script>
@umodoc
Copy link
Owner

umodoc commented Feb 14, 2025

see #154 .
Version 4 has some unpredictable issues caused by pagination. This error seems to be due to the timing of the pagination extension's loading. It is recommended that you pull the code, track the issue yourself, and make the necessary modifications.

@umodoc umodoc closed this as completed Feb 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants