mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-11-24 19:59:02 +08:00
32 lines
616 B
TypeScript
32 lines
616 B
TypeScript
import { defineComponent, h } from 'vue'
|
|
|
|
export const NodeViewWrapper = defineComponent({
|
|
name: 'NodeViewWrapper',
|
|
|
|
props: {
|
|
as: {
|
|
type: String,
|
|
default: 'div',
|
|
},
|
|
},
|
|
|
|
inject: ['onDragStart', 'decorationClasses'],
|
|
|
|
render() {
|
|
return h(
|
|
this.as,
|
|
{
|
|
// @ts-ignore
|
|
class: this.decorationClasses,
|
|
style: {
|
|
whiteSpace: 'normal',
|
|
},
|
|
'data-node-view-wrapper': '',
|
|
// @ts-ignore (https://github.com/vuejs/vue-next/issues/3031)
|
|
onDragstart: this.onDragStart,
|
|
},
|
|
this.$slots.default?.(),
|
|
)
|
|
},
|
|
})
|