added replace and replaceAll commands

This commit is contained in:
Chrissi2812
2019-06-03 12:18:59 +02:00
parent 525619ad26
commit 2544e40f99
2 changed files with 45 additions and 1 deletions

View File

@@ -121,9 +121,16 @@
placeholder="Search..."
type="text"
v-model="searchTerm"
>
><input
@keydown.enter.prevent="editor.commands.replace(replaceWith)"
placeholder="Replace..."
type="text"
v-model="replaceWith"
>
<button @click="editor.commands.find(searchTerm)">Find</button>
<button @click="editor.commands.clearSearch()">Clear</button>
<button @click="editor.commands.replace(replaceWith)">Replace</button>
<button @click="editor.commands.replaceAll(replaceWith)">Replace All</button>
</div>
</span>
@@ -168,6 +175,7 @@ export default {
return {
searching: false,
searchTerm: null,
replaceWith: null,
editor: new Editor({
extensions: [
new Blockquote(),