add table commands, add tableRole to the schema, add buttons to the example
This commit is contained in:
@@ -1,5 +1,44 @@
|
||||
<template>
|
||||
<div v-if="editor">
|
||||
<button disabled>
|
||||
⚠️ createTable
|
||||
</button>
|
||||
<button @click="editor.chain().focus().addColumnBefore().run()">
|
||||
⚠️ addColumnBefore
|
||||
</button>
|
||||
<button @click="editor.chain().focus().addColumnAfter().run()">
|
||||
⚠️ addColumnAfter
|
||||
</button>
|
||||
<button @click="editor.chain().focus().deleteColumn().run()">
|
||||
⚠️ deleteColumn
|
||||
</button>
|
||||
<button @click="editor.chain().focus().addRowBefore().run()">
|
||||
⚠️ addRowBefore
|
||||
</button>
|
||||
<button @click="editor.chain().focus().addRowAfter().run()">
|
||||
⚠️ addRowAfter
|
||||
</button>
|
||||
<button @click="editor.chain().focus().deleteRow().run()">
|
||||
⚠️ deleteRow
|
||||
</button>
|
||||
<button @click="editor.chain().focus().deleteTable().run()">
|
||||
✅ deleteTable
|
||||
</button>
|
||||
<button @click="editor.chain().focus().mergeCells().run()">
|
||||
⚠️ mergeCells
|
||||
</button>
|
||||
<button @click="editor.chain().focus().splitCell().run()">
|
||||
⚠️ splitCell
|
||||
</button>
|
||||
<button @click="editor.chain().focus().toggleHeaderColumn().run()">
|
||||
⚠️ toggleHeaderColumn
|
||||
</button>
|
||||
<button @click="editor.chain().focus().toggleHeaderRow().run()">
|
||||
⚠️ toggleHeaderRow
|
||||
</button>
|
||||
<button @click="editor.chain().focus().toggleHeaderCell().run()">
|
||||
⚠️ toggleHeaderCell
|
||||
</button>
|
||||
<editor-content :editor="editor" />
|
||||
</div>
|
||||
</template>
|
||||
@@ -57,8 +96,10 @@ export default {
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
table, tr, td {
|
||||
border: 3px solid red;
|
||||
<style lang="scss">
|
||||
.ProseMirror {
|
||||
table, tr, td {
|
||||
border: 3px solid red;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user