init table, table-row and table-cell
This commit is contained in:
7
docs/src/demos/Nodes/Table/index.spec.js
Normal file
7
docs/src/demos/Nodes/Table/index.spec.js
Normal file
@@ -0,0 +1,7 @@
|
||||
context('/api/nodes/table', () => {
|
||||
before(() => {
|
||||
cy.visit('/api/nodes/table')
|
||||
})
|
||||
|
||||
// TODO: Write tests
|
||||
})
|
||||
62
docs/src/demos/Nodes/Table/index.vue
Normal file
62
docs/src/demos/Nodes/Table/index.vue
Normal 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>
|
||||
Reference in New Issue
Block a user