balm-ui
Version:
A modular and customizable UI library based on Material Design and Vue 3
32 lines (22 loc) • 622 B
JavaScript
import { useEditor } from '../core/quill';
function pasteHtml() {}
function pasteText() {}
function useClipboard() {
const { Quill, toolbarHandlers } = useEditor();
toolbarHandlers.cut = () => {
const { quill } = useEditor();
let range = quill.getSelection();
if (range) {
quill.deleteText(range, Quill.sources.USER);
quill.setSelection(range.index, Quill.sources.SILENT);
}
};
toolbarHandlers.copy = () => {
const { quill } = useEditor();
let range = quill.getSelection();
if (range) {
}
};
toolbarHandlers.paste = () => {};
}
export default useClipboard;