2021-03-05 07:02:28 +08:00
|
|
|
import { h, defineComponent } from 'vue'
|
|
|
|
|
|
|
|
export const NodeViewWrapper = defineComponent({
|
|
|
|
props: {
|
|
|
|
as: {
|
|
|
|
type: String,
|
|
|
|
default: 'div',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
2021-04-04 05:15:13 +08:00
|
|
|
inject: ['onDragStart', 'decorationClasses'],
|
2021-03-05 07:02:28 +08:00
|
|
|
|
|
|
|
render() {
|
|
|
|
return h(
|
|
|
|
this.as, {
|
2021-04-04 05:15:13 +08:00
|
|
|
// @ts-ignore
|
|
|
|
class: this.decorationClasses.value,
|
2021-03-05 07:02:28 +08:00
|
|
|
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)
|
2021-03-05 07:02:28 +08:00
|
|
|
onDragStart: this.onDragStart,
|
|
|
|
},
|
|
|
|
this.$slots.default?.(),
|
|
|
|
)
|
|
|
|
},
|
|
|
|
})
|