mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-12-25 02:07:49 +08:00
26 lines
475 B
TypeScript
26 lines
475 B
TypeScript
|
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,
|
||
|
},
|
||
|
)
|
||
|
},
|
||
|
})
|