我的代码未能编译v-else used on element <div> without corresponding v-if.
是什么?
在<div class="card">
中,我要有条件地渲染input
,并显示editor-container
或ql-editor
。
<template>
<li
class="component composition">
<div
v-if="editable == true"
class="drag-handle">
<icon-drag-handle></icon-drag-handle>
</div>
<div class="card">
<input
v-if="component"
@keypress="setUnsaved(true); autosave($event, "title", editorTitleId)">
</input>
<div
v-if="editable==true"
@keypress="setUnsaved(true); autosave($event, "content", editorContentId)"
class="editor-container">
</div>
<div
v-else
v-html="compositionContentHTML"
class="ql-editor">
</div>
</div>
<div
v-if="editable == true"
class="component-actions">
<a @click.prevent.stop="deleteComponent">
<icon-times></icon-times>
</a>
</div>
</li>
</template>