@huanshao/upload-adapter-qiniu-common

1.0.3 • Public • Published

CKEditor uploadAdapter 七牛云版本

usage

    import React, { Component } from 'react';
    import CKEditor from '@ckeditor/ckeditor5-react';
    import ClassicEditor from '@ckeditor/ckeditor5-build-classic';
    import uploadAdapterQiniu from '@huanshao/upload-adapter-qiniu-common'
    
    class App extends Component{
        getToken = ()=>{
            return new Promise(resolve=>{
            const token = "";
                resolve(token)
            })
        }
        
        qiniuCdnDomain = "http://example.com"
        
        render(){
            return (
                <CKEditor 
                    editor={ClassicEditor}
                    onInit={editor => {
                        uploadAdapterQiniu(editor,this.getToken,this.qiniuCdnDomain)
                    }}
                />
            )
        }
    }

params

  1. editor ckeditor实例
  2. getToken function 需要返回一个promise,token
  3. domain

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.3
    1
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.3
    1
  • 1.0.2
    0
  • 1.0.0
    0

Package Sidebar

Install

npm i @huanshao/upload-adapter-qiniu-common

Weekly Downloads

0

Version

1.0.3

License

ISC

Unpacked Size

74.1 kB

Total Files

3

Last publish

Collaborators

  • macjohson