mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-12-23 17:07:49 +08:00
29 lines
588 B
TypeScript
29 lines
588 B
TypeScript
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': '',
|
|
// @ts-ignore (https://github.com/vuejs/vue-next/issues/3031)
|
|
onDragStart: this.onDragStart,
|
|
},
|
|
this.$slots.default?.(),
|
|
)
|
|
},
|
|
})
|