ckeditor5 图片上传地址配置

位置:首页>博客>详情   分类:WEB基础   阅读(309)   2023-03-28 11:29:14
ckeditor5 图片上传地址配置,ckeditor5和4的图片上传配置有点不一样。首先是确定你选的上传支持插件是什么,我这里是下面这个插件
ckfinder upload adapter
ckfinder upload adapter
以次控件配置图片上传地址为:
ClassicEditor
                .create( document.querySelector( '#contentHtml' ), {
                    licenseKey: '',
                    ckfinder: {
                        uploadUrl: "/ajax/form/admin/file/blogUploadImage?type=Image"//图片上传路径
                    },
                    
                } )
                .then( editor => {
                    editor.setData($('#cocntentScript').html());
                    window.editor = editor;
                } )
                .catch( error => {
                    console.error( 'Oops, something went wrong!' );
                    console.error( 'Please, report the following error on https://github.com/ckeditor/ckeditor5/issues with the build id and the error stack trace:' );
                    console.warn( 'Build id: l1txv9x2i4j9-f8u2t0fifydx' );
                    console.error( error );
                } );
就是对应的ckfinder:{uploadUrl:'地址'}



 
地址:https://www.leftso.com/article/1125.html