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

Ability to upload images using component's events #3

Open
davidmeirlevy opened this issue Oct 10, 2020 · 0 comments
Open

Ability to upload images using component's events #3

davidmeirlevy opened this issue Oct 10, 2020 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@davidmeirlevy
Copy link
Contributor

create a plugin to CKEditor that triggered an image drop or select:
https://ckeditor.com/docs/ckeditor5/latest/framework/guides/deep-dive/upload-adapter.html

The component should emit a file event, that includes the actual file selected, and a callbacks to get the file URL after uploaded, or an error.

from the client perspective, the usage should look like:

<template>
<gp-editor :value="value" @file=onFileUpload"/>
</template>
<script>
export default {
  setup() {
    const onFileUpload = ({file, resolve, reject}) => {
       callUploadApi(file)
         .then(url => resolve({url}))
         .catch(() => reject(new Error()))
    }
    return {value: 'bla bla', onFileUpload}
  }
}
</script>
@davidmeirlevy davidmeirlevy added enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed labels Oct 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant