1.0.3 • Published 10 months ago
tiptap-extension-majestic-image v1.0.3
Image extension for tiptap & majestic-ui
import tiptapImageExtension from 'tiptap-extension-majestic-image'
const editor = ref()
onMounted(() => {
editor.value = new Editor({
extensions: [
tiptapImageExtension,
]
})
})
const addImage = ({ path, id }: { path: string; id: number }) => {
editor.value
?.chain()
.focus()
.setImage({ src: path, id: `image-${id}` })
.run()
}