Closed Carson-czl closed 3 months ago
Hi @Carson-czl,
Firstly, there is a minor issue with the import as it should be import 'tinymce/plugins/lists';
. However, I'm not convinced that's the sole issue here so I'm going to transfer this to the tinymce-vue
repo where our integrations team are betted suited to help since this appears to be specific to bundling with Vue and Vite.
Ref: INT-2883
Do you have a solution to address this problem now? This problem is a confusing thing. Looking forward to your reply. thankyou!
Your imports should look something like this:
// TinyMCE
import 'tinymce/tinymce' // <---- MUST COME FIRST
import 'tinymce/icons/default/icons'
import 'tinymce/themes/silver/theme'
import 'tinymce/models/dom/model'
import 'tinymce/skins/ui/oxide/skin.css'
// TinyMCE plugins
// https://www.tiny.cloud/docs/tinymce/6/plugins/
import 'tinymce/plugins/lists/plugin'
import 'tinymce/plugins/link/plugin'
import 'tinymce/plugins/image/plugin'
import 'tinymce/plugins/table/plugin'
import 'tinymce/plugins/code/plugin'
import 'tinymce/plugins/help/plugin'
import 'tinymce/plugins/wordcount/plugin'
import Editor from '@tinymce/tinymce-vue'
Hi I have the same problem.
"dependencies": {
"@tinymce/tinymce-vue": "^5.1.1",
"tinymce": "^6.8.3",
.............
}
I have written this code in the component:
<script setup>
//` TinyMCE
import tinymce from "tinymce";
import 'tinymce/icons/default/icons'
import 'tinymce/themes/silver/theme'
import 'tinymce/models/dom/model'
import 'tinymce/skins/ui/oxide/skin'
import 'tinymce/skins/ui/oxide-dark/content'
import 'tinymce/skins/content/dark/content'
// TinyMCE plugins
// https://www.tiny.cloud/docs/tinymce/6/plugins/
import 'tinymce/plugins/code/plugin'
import 'tinymce/plugins/directionality/plugin'
import 'tinymce/plugins/image/plugin'
import 'tinymce/plugins/link/plugin'
import 'tinymce/plugins/table/plugin'
import 'tinymce/plugins/fullscreen/plugin'
import 'tinymce/plugins/charmap/plugin'
import 'tinymce/plugins/pagebreak/plugin'
import 'tinymce/plugins/nonbreaking/plugin'
import 'tinymce/plugins/anchor/plugin'
import 'tinymce/plugins/advlist/plugin'
import 'tinymce/plugins/lists/plugin'
import '@/js/tinymce/fa'
const options = reactive({
directionality : 'rtl',
language: 'fa',
plugins: 'code directionality fullscreen image link table charmap pagebreak nonbreaking anchor advlist lists',
toolbar: 'fullscreen | bold italic underline strikethrough | rtl ltr | fontsize | alignright aligncenter alignleft alignjustify | outdent indent | numlist bullist | forecolor backcolor removeformat | pagebreak | charmap | image link',
menubar: 'edit view insert format table',
font_formats: 'IRANSans=IRANSans; Andale Mono=andale mono,times; Arial=arial,helvetica,sans-serif; Arial Black=arial black,avant garde; Book Antiqua=book antiqua,palatino; Comic Sans MS=comic sans ms,sans-serif; Courier New=courier new,courier; Georgia=georgia,palatino; Helvetica=helvetica; Impact=impact,chicago; Oswald=oswald; Symbol=symbol; Tahoma=tahoma,arial,helvetica,sans-serif; Terminal=terminal,monaco; Times New Roman=times new roman,times; Trebuchet MS=trebuchet ms,geneva; Verdana=verdana,geneva; Webdings=webdings; Wingdings=wingdings,zapf dingbats',
extended_valid_elements:'svg[*],path[*]',
image_advtab: true,
image_class_list: [
{ title: 'None', value: '' },
{ title: 'w-full', value: 'w-fu11' },
],
height: 500,
toolbar_mode: 'sliding',
skin: document.getElementsByTagName('html')[0].classList.contains('dark') ? 'oxide-dark' : 'oxide',
content_css: document.getElementsByTagName('html')[0].classList.contains('dark') ? 'dark' : 'default',
content_style: 'body { font-size:16px }',
});
let props = defineProps({
mag: Object,
errors: Object,
});
let form = reactive({
content: props.mag.content,
});
</script>
<template>
<Editor id="body" v-model="form.content" api-key='my-api-key' :init="options" />
</template>
I have the same problem that @bardiaabasirad. In my case with a Vue 3 (ECMAScript 6) Vite project I can't specify the correct path to my custom plugin (if I put the custom plugin into the 'public' folder TinyMCE understand I placed into the official TinyMCe plugins folder, instead of the 'public' one). If I put it into another folder the project returns an 404 (NOT FOUND) error...
Please, is there anyone who found the solution to this?
Thank you.
This issue is stale because it has been open 30 days with no activity. Please comment if you wish to keep this issue open or it will be closed in 7 days.
This issue was closed because it has been stalled for 7 days with no activity.
If the plug-in package is imported from JS, TS will report an error