没有对应的v-if的Vue v-else

时间:2018-07-28 19:02:16

标签: vue.js

我的代码未能编译v-else used on element <div> without corresponding v-if.是什么?

<div class="card">中,我要有条件地渲染input,并显示editor-containerql-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>

0 个答案:

没有答案