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

161
Views
Vue doesn't show whole component

I'am a newbie to Vue.

I want to put whole page to component besides header and footer

Vue.component('main-block', {template: `
<section id="first-block">...</section>
<section id="second-block">...</section>
<section id="third-block">...</section>`})

When I write <main-page></main-page> inside #app block, it shows only the first section. Why?

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

0

Following the documentation: A-Single-Root-Element

You can't have more than one root element in your component.

every component must have a single root element

Which means that you have to wrap your template in a root element, ex. a div element

For instance:

Vue.component('main-block', {template: `
<div>
  <section id="first-block">...</section>
  <section id="second-block">...</section>
  <section id="third-block">...</section>
</div>`})
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!