add NodeViewWrapper and NodeViewContent component
This commit is contained in:
26
packages/vue-3/src/NodeViewWrapper.ts
Normal file
26
packages/vue-3/src/NodeViewWrapper.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
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?.(),
|
||||
)
|
||||
},
|
||||
})
|
||||
Reference in New Issue
Block a user