add NodeViewWrapper and NodeViewContent to vue-2
This commit is contained in:
30
packages/vue-2/src/NodeViewWrapper.ts
Normal file
30
packages/vue-2/src/NodeViewWrapper.ts
Normal file
@@ -0,0 +1,30 @@
|
||||
import Vue from 'vue'
|
||||
|
||||
export const NodeViewWrapper = Vue.extend({
|
||||
props: {
|
||||
as: {
|
||||
type: String,
|
||||
default: 'div',
|
||||
},
|
||||
},
|
||||
|
||||
inject: ['onDragStart'],
|
||||
|
||||
render(createElement) {
|
||||
return createElement(
|
||||
this.as, {
|
||||
style: {
|
||||
whiteSpace: 'normal',
|
||||
},
|
||||
attrs: {
|
||||
'data-node-view-wrapper': '',
|
||||
},
|
||||
on: {
|
||||
// @ts-ignore
|
||||
dragstart: this.onDragStart,
|
||||
},
|
||||
},
|
||||
this.$slots.default,
|
||||
)
|
||||
},
|
||||
})
|
||||
Reference in New Issue
Block a user