Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

378
Views
Si usa v-if en varios elementos, use v-else-if para encadenarlos después de actualizar a vue 2.x

Hoy, cuando actualizo Vue a 2.x, muestra un error como este:

 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>)

este es el código fuente de tpl.html :

 <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>

¿Por qué pasó esto? ¿Qué debo hacer para solucionar este problema?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Como dijo el error, envuelva todo en un div, así que intente mover <st-box v-ref:st></st-box> dentro de <section block

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!