关于vue单页应用中.vue文件<template>下元素标签与<script>中components的关联的问题

请问以下代码template中的sidebar是如何与script中的Sidebar关联起来的呢?初学vue.js,很多东西不是太懂,官网上也没搜到答案
还望前端大神不吝赐教,在此先行谢过。

<template>
  <div class="app-wrapper" :class="{hideSidebar:!sidebar.opened}">
    <sidebar class="sidebar-container"></sidebar>
    <div class="main-container">
      <navbar></navbar>
      <app-main></app-main>
    </div>
  </div>
</template>

<script>
import { Navbar, Sidebar, AppMain } from '@/views/layout/components'

export default {
  name: 'layout',
  components: {
    Navbar,
    Sidebar,
    AppMain
  },
  computed: {
    sidebar() {
      return this.$store.state.app.sidebar
    }
  }
}
</script>

<style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss";
.app-wrapper {
  @include clearfix;
  position: relative;
  height: 100%;
  width: 100%;
}
</style>

  1. script中通过import引入的组件,必须要在components中注册之后,才能在template中使用。
  2. 因为HTML标签对大小写不敏感,所以components中注册的组件名称如果包含大写字母,在template中可以直接转为小写字母。但是components中注册的组件名称如果是驼峰命名,在template中转为小写字母时使用“-”代替驼峰。

https://my.oschina.net/u/554046/blog/2248775

通过

computed: {
    sidebar() {
      return this.$store.state.app.sidebar
    }
  }

定义了这个sidebar组件,就可以在template中用了

<template>
    <sidebar></sidebar>
</template>

this.$store.state.app.sidebar
是你vuex中存放的数据,即sidebar这个组件的模板