search

Home  >  Q&A  >  body text

javascript - vue multiple component references

<template>
<vhead></vhead>
<menu></menu>
</template>
<script>
import vhead from './head'
import menu from './nav'
export default {

name: 'home',
components: {vhead, menu}

}
</script>
<style>
html, body {

position: relative;
height: 100%;

}

body {

background-color: #e5e5e5;

}
</style>
Are multiple components introduced in this form? I keep getting errors here, I don’t know why

大家讲道理大家讲道理2791 days ago396

reply all(1)I'll reply

  • 漂亮男人

    漂亮男人2017-05-19 10:19:42

    You can see the longest line in the error message, which indicates that it needs to be wrapped in a root node

    <p>
        <vhead></vhead>
        <menu></menu>
    </p>

    reply
    0
  • Cancelreply