init table, table-row and table-cell

This commit is contained in:
Hans Pagel
2021-01-20 23:42:01 +01:00
parent 7efc1a3ac3
commit 6a1661cf9f
15 changed files with 244 additions and 0 deletions

View File

@@ -0,0 +1,7 @@
context('/api/nodes/table', () => {
before(() => {
cy.visit('/api/nodes/table')
})
// TODO: Write tests
})

View File

@@ -0,0 +1,62 @@
<template>
<div v-if="editor">
<editor-content :editor="editor" />
</div>
</template>
<script>
import { Editor } from '@tiptap/core'
import { EditorContent } from '@tiptap/vue'
import Document from '@tiptap/extension-document'
import Paragraph from '@tiptap/extension-paragraph'
import Text from '@tiptap/extension-text'
import Table from '@tiptap/extension-table'
import TableRow from '@tiptap/extension-table-row'
import TableCell from '@tiptap/extension-table-cell'
export default {
components: {
EditorContent,
},
data() {
return {
editor: null,
}
},
mounted() {
this.editor = new Editor({
extensions: [
Document,
Paragraph,
Text,
Table,
TableRow,
TableCell,
],
content: `
<p>Example Text</p>
<table>
<tr>
<td>Test</td>
<td>Test</td>
<td>Test</td>
</tr>
</table>
<p>Example Text</p>
`,
})
},
beforeDestroy() {
this.editor.destroy()
},
}
</script>
<style>
table {
border: 3px solid red;
}
</style>

View File

@@ -5,3 +5,7 @@ We need your support to maintain, update, support and develop tiptap 2. If you
:::
TODO
⚠️ Preview
<demo name="Nodes/Table" />