check if mark has attributes

This commit is contained in:
Hans Pagel
2020-10-05 17:12:57 +02:00
parent 021d911ad6
commit 1d5d1f7c6e
4 changed files with 23 additions and 6 deletions

View File

@@ -1,6 +1,11 @@
<template>
<div v-if="editor">
<button @click="editor.chain().focus().highlight().run()" :class="{ 'is-active': editor.isActive('highlight') }">
<button
@click="editor.chain().focus().highlight().run()"
:class="{ 'is-active': editor.isActive('highlight', {
color: ''
}) }"
>
highlight (default)
</button>
<button @click="editor.chain().focus().highlight({ color: 'red' }).run()" :class="{ 'is-active': editor.isActive('highlight', { color: 'red' }) }">
@@ -53,7 +58,7 @@ export default {
content: `
<p>This isnt highlighted.</s></p>
<p><mark>But that one is.</mark></p>
<p><mark style="background-color: pink;">And this is highlighted too, but in a different color.</mark></p>
<p><mark style="background-color: red;">And this is highlighted too, but in a different color.</mark></p>
`,
})
},