add mark demos
This commit is contained in:
15
demos/src/Marks/TextStyle/Vue/index.html
Normal file
15
demos/src/Marks/TextStyle/Vue/index.html
Normal file
@@ -0,0 +1,15 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<script type="module">
|
||||
import setup from '../../../../setup/vue.ts'
|
||||
import source from '@source'
|
||||
setup('Marks/TextStyle', source)
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
7
demos/src/Marks/TextStyle/Vue/index.spec.js
Normal file
7
demos/src/Marks/TextStyle/Vue/index.spec.js
Normal file
@@ -0,0 +1,7 @@
|
||||
context('/demos/Marks/TextStyle', () => {
|
||||
before(() => {
|
||||
cy.visit('/demos/Marks/TextStyle')
|
||||
})
|
||||
|
||||
// TODO: Write tests
|
||||
})
|
||||
44
demos/src/Marks/TextStyle/Vue/index.vue
Normal file
44
demos/src/Marks/TextStyle/Vue/index.vue
Normal file
@@ -0,0 +1,44 @@
|
||||
<template>
|
||||
<div v-if="editor">
|
||||
<editor-content :editor="editor" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { Editor, EditorContent } from '@tiptap/vue-3'
|
||||
import Document from '@tiptap/extension-document'
|
||||
import Paragraph from '@tiptap/extension-paragraph'
|
||||
import Text from '@tiptap/extension-text'
|
||||
import TextStyle from '@tiptap/extension-text-style'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
EditorContent,
|
||||
},
|
||||
|
||||
data() {
|
||||
return {
|
||||
editor: null,
|
||||
}
|
||||
},
|
||||
|
||||
mounted() {
|
||||
this.editor = new Editor({
|
||||
extensions: [
|
||||
Document,
|
||||
Paragraph,
|
||||
Text,
|
||||
TextStyle,
|
||||
],
|
||||
content: `
|
||||
<p><span>This has a <span> tag without a style attribute, so it’s thrown away.</span></p>
|
||||
<p><span style="">But this one is wrapped in a <span> tag with an inline style attribute, so it’s kept - even if it’s empty for now.</span></p>
|
||||
`,
|
||||
})
|
||||
},
|
||||
|
||||
beforeDestroy() {
|
||||
this.editor.destroy()
|
||||
},
|
||||
}
|
||||
</script>
|
||||
Reference in New Issue
Block a user