Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

386
Visualizações
If you are using v-if on multiple elements, use v-else-if to chain them instead after upgrade to vue 2.x

Today when I upgrade Vue to 2.x, shows error like this:

commons1.js:23487 [Vue warn]: Error compiling template:

Component template should contain exactly one root element. If you are using v-if on multiple elements, use v-else-if to chain them instead.

6  |      划词翻译没有权限操作当前网页
7  |    </div>
8  |  </section>
   |             
9  |  <st-box v-ref:st></st-box>
   |  ^^^^^^^^^^^^^^^^^^^^^^^^^^
10 |  

(found in <Root>)

this is the tpl.html source code looks like:

<section class="text-center functions">
  <div v-if="canInject">
    <div role="button" @click="switchEnable" :title="'点击切换为'+(enabled?'禁':'启')+'用状态'">已对当前网站<span v-if="enabled">启用</span><span v-else>禁用</span></div>
  </div>
  <div v-else>
    划词翻译没有权限操作当前网页
  </div>
</section>
<st-box v-ref:st></st-box>

Why did this happen? What should I do to fix this problem?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Like error said, wrap everything in one div, so try to move <st-box v-ref:st></st-box> inside <section block

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda