add NodeViewWrapper and NodeViewContent to vue-2

This commit is contained in:
Philipp Kühn
2021-03-05 10:18:44 +01:00
parent 27b55a2c53
commit 983b56a5f2
10 changed files with 127 additions and 80 deletions

View File

@@ -26,6 +26,7 @@
</template>
<script>
import { NodeViewWrapper } from '@tiptap/vue-2'
import { v4 as uuid } from 'uuid'
import * as d3 from 'd3'
import simplify from 'simplify-js'
@@ -37,6 +38,10 @@ const getRandomElement = list => {
export default {
name: 'Paper',
components: {
NodeViewWrapper,
},
props: {
updateAttributes: {
type: Function,

View File

@@ -10,6 +10,17 @@
</node-view-wrapper>
</template>
<script>
import { NodeViewWrapper, NodeViewContent } from '@tiptap/vue-2'
export default {
components: {
NodeViewWrapper,
NodeViewContent,
},
}
</script>
<style lang="scss" scoped>
.draggable-item {
display: flex;

View File

@@ -14,7 +14,13 @@
</template>
<script>
import { NodeViewWrapper } from '@tiptap/vue-2'
export default {
components: {
NodeViewWrapper,
},
props: {
editor: {
type: Object,

View File

@@ -97,13 +97,17 @@ export default Node.create({
```html
<template>
<node-view-wrapper>
<node-view-content />
</node-view-wrapper>
<node-view-wrapper />
</template>
<script>
import { NodeViewWrapper } from '@tiptap/vue-2'
export default {
components: {
NodeViewWrapper,
},
props: {
editor: {
type: Object,
@@ -145,6 +149,16 @@ export default {
<node-view-content class="content-dom" />
</node-view-wrapper>
</template>
<script>
import { NodeViewWrapper, NodeViewContent } from '@tiptap/vue-2'
export default {
components: {
NodeViewWrapper,
NodeViewContent,
},
}
```
## Reference