tiptap/packages/vue-3/src/NodeViewWrapper.ts
Philipp Kühn 328d5a459d refactoring
2021-03-05 09:46:47 +01:00

27 lines
500 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 (https://github.com/vuejs/vue-next/issues/3031)
onDragStart: this.onDragStart,
},
this.$slots.default?.(),
)
},
})