tiptap/packages/vue-3/src/NodeViewWrapper.ts

29 lines
588 B
TypeScript
Raw Normal View History

import { h, defineComponent } from 'vue'
export const NodeViewWrapper = defineComponent({
props: {
as: {
type: String,
default: 'div',
},
},
inject: ['onDragStart', 'decorationClasses'],
render() {
return h(
this.as, {
// @ts-ignore
class: this.decorationClasses.value,
style: {
whiteSpace: 'normal',
},
'data-node-view-wrapper': '',
2021-03-05 16:46:47 +08:00
// @ts-ignore (https://github.com/vuejs/vue-next/issues/3031)
onDragStart: this.onDragStart,
},
this.$slots.default?.(),
)
},
})