tiptap/packages/vue-3/src/NodeViewWrapper.ts
2021-03-05 00:02:28 +01:00

27 lines
452 B
TypeScript

import { h, defineComponent } from 'vue'
export const NodeViewWrapper = defineComponent({
props: {
as: {
type: String,
default: 'div',
},
},
inject: ['onDragStart'],
render() {
return h(
this.as, {
style: {
whiteSpace: 'normal',
},
'data-node-view-wrapper': '',
// @ts-ignore
onDragStart: this.onDragStart,
},
this.$slots.default?.(),
)
},
})