tiptap-extension-majestic-image
v1.0.3
Published
image extension for tiptap & majestic-ui
Downloads
4
Maintainers
Readme
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()
}