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