tinymce / tinymce-vue

Official TinyMCE Vue component
MIT License
2.01k stars 202 forks source link

Uncaught TypeError: Cannot read properties of null (reading 'init') #390

Open newalway opened 9 months ago

newalway commented 9 months ago

In file Index.vue

<script setup>
import { defineAsyncComponent , h, ref ,inject,watch ,provide,computed } from 'vue'

const Editor = defineAsyncComponent(() => import ('@tinymce/tinymce-vue'))

</script>

<template>
                        <div class="mb-2">
                            <Editor 
                                    v-model="form.description"
                                    api-key="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
                                    :init="{
                                    height: 500,
                                    menubar: false,
                                    plugins: [
                                        'lists','link','image','charmap','preview','anchor','searchreplace','visualblocks',
                                        'fullscreen','insertdatetime','media','table','help','wordcount','code'
                                    ],
                                    toolbar:[
                                        'undo redo | casechange blocks | bold italic backcolor | \
                                        alignleft aligncenter alignright alignjustify | \
                                        bullist numlst numlist  checklist outdent indent | removeformat |  code table help '],
                                    keep_styles: false,
                                    style_formats_merge: true,
                                    style_formats: [
                                    { title: 'Unstyled list', selector: 'ul,ol', classes: 'list-none' }
                                        ]
                                    }"
                                    initial-value="Welcome to TinyMCE Vue"
                                />
                        </div>
</template>

Capture

pakage.json "vue": "^3.2.31" "@tinymce/tinymce-vue": "^5.1.0",

Laravel 9 + ViteJS + InertiaJS

TinyITAdmin commented 9 months ago

Ref: INT-3229