fix search replace example

This commit is contained in:
Philipp Kühn 2019-08-20 15:55:27 +02:00
parent 0c3a8d3888
commit 0e246e843a

View File

@ -104,38 +104,37 @@
> >
<icon name="redo" /> <icon name="redo" />
</button> </button>
<div class="search">
<input
ref="search"
@keydown.enter.prevent="editor.commands.find(searchTerm)"
placeholder="Search …"
type="text"
v-model="searchTerm"
/>
<input
@keydown.enter.prevent="editor.commands.replace(replaceWith)"
placeholder="Replace …"
type="text"
v-model="replaceWith"
/>
<button class="button" @click="editor.commands.find(searchTerm)">
Find
</button>
<button class="button" @click="editor.commands.clearSearch()">
Clear
</button>
<button class="button" @click="editor.commands.replace(replaceWith)">
Replace
</button>
<button class="button" @click="editor.commands.replaceAll(replaceWith)">
Replace All
</button>
</div>
</div> </div>
</editor-menu-bar> </editor-menu-bar>
<div class="search">
<input
ref="search"
@keydown.enter.prevent="editor.commands.find(searchTerm)"
placeholder="Search …"
type="text"
v-model="searchTerm"
/>
<input
@keydown.enter.prevent="editor.commands.replace(replaceWith)"
placeholder="Replace …"
type="text"
v-model="replaceWith"
/>
<button class="button" @click="editor.commands.find(searchTerm)">
Find
</button>
<button class="button" @click="editor.commands.clearSearch()">
Clear
</button>
<button class="button" @click="editor.commands.replace(replaceWith)">
Replace
</button>
<button class="button" @click="editor.commands.replaceAll(replaceWith)">
Replace All
</button>
</div>
<editor-content class="editor__content" :editor="editor" /> <editor-content class="editor__content" :editor="editor" />
</div> </div>
</template> </template>
@ -224,7 +223,7 @@ export default {
background-color: rgba($color-black, 0.1); background-color: rgba($color-black, 0.1);
padding: 0.5rem; padding: 0.5rem;
border-radius: 5px; border-radius: 5px;
margin-top: 1rem; margin: 1rem 0;
input { input {
padding: 0.25rem; padding: 0.25rem;