add the strike extension documentation
This commit is contained in:
5
docs/src/demos/Extensions/Strike/index.spec.js
Normal file
5
docs/src/demos/Extensions/Strike/index.spec.js
Normal file
@@ -0,0 +1,5 @@
|
||||
context('/api/extensions/strike', () => {
|
||||
beforeEach(() => {
|
||||
cy.visit('/api/extensions/strike')
|
||||
})
|
||||
})
|
||||
54
docs/src/demos/Extensions/Strike/index.vue
Normal file
54
docs/src/demos/Extensions/Strike/index.vue
Normal file
@@ -0,0 +1,54 @@
|
||||
<template>
|
||||
<div v-if="editor">
|
||||
<button @click="editor.focus().strike()" :class="{ 'is-active': editor.isActive('strike') }">
|
||||
strike
|
||||
</button>
|
||||
|
||||
<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 Strike from '@tiptap/extension-strike'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
EditorContent,
|
||||
},
|
||||
|
||||
data() {
|
||||
return {
|
||||
editor: null,
|
||||
}
|
||||
},
|
||||
|
||||
mounted() {
|
||||
this.editor = new Editor({
|
||||
extensions: [
|
||||
Document(),
|
||||
Paragraph(),
|
||||
Text(),
|
||||
// Strike(),
|
||||
],
|
||||
content: `
|
||||
<p>This isn’t striked through.</s></p>
|
||||
<p><s>But that’s striked through.</s></p>
|
||||
<p><del>And this.</del></p>
|
||||
<p><strike>This too.</strike></p>
|
||||
<p style="text-decoration: line-through">This as well.</p>
|
||||
`,
|
||||
})
|
||||
|
||||
window.editor = this.editor
|
||||
},
|
||||
|
||||
beforeDestroy() {
|
||||
this.editor.destroy()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
Reference in New Issue
Block a user