add NodeViewWrapper and NodeViewContent component
This commit is contained in:
25
packages/vue-3/src/NodeViewContent.ts
Normal file
25
packages/vue-3/src/NodeViewContent.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import { h, defineComponent } from 'vue'
|
||||
|
||||
export const NodeViewContent = defineComponent({
|
||||
props: {
|
||||
as: {
|
||||
type: String,
|
||||
default: 'div',
|
||||
},
|
||||
},
|
||||
|
||||
inject: ['editable'],
|
||||
|
||||
render() {
|
||||
return h(
|
||||
this.as, {
|
||||
style: {
|
||||
whiteSpace: 'pre-wrap',
|
||||
},
|
||||
'data-node-view-content': '',
|
||||
// @ts-ignore (https://github.com/vuejs/vue-next/issues/3031)
|
||||
contenteditable: this.editable.value,
|
||||
},
|
||||
)
|
||||
},
|
||||
})
|
||||
Reference in New Issue
Block a user