<template>
  <div style="height: calc(100vh - 59px);">
    <div v-if="$store.getters.sidebarOpened" class="pd8">
      <el-input v-model="keyword" style="max-width:600px" placeholder="请输入关键字" clearable class="input-with-select"
        @clear="onSelectKeyword" @keydown.enter="onSelectKeyword">
        <template #append>
          <el-button icon="Search" @click="onSelectKeyword" />
        </template>
      </el-input>
    </div>
    <el-scrollbar height="calc(100% - 48px)">
      <SideBarMenu ref="sideBarMenu"></SideBarMenu>
    </el-scrollbar>
  </div>
</template>

<script setup>
import { ref } from "vue"
import SideBarMenu from "./SideBarMenu.vue";
const keyword = ref("")
const sideBarMenu = ref()
const logoHeight = 44;
const onSelectKeyword = () => {
  console.log(keyword.value, 'keyword.value');
  sideBarMenu.value.kwywordFilterRoute(keyword.value)
}

</script>

<style lang="scss" scoped>
.logo-container {
  height: v-bind(logoHeight) + "px";
  padding: 10px 0 22px 0;
  display: flex;
  align-items: center;
  justify-content: center;

  .logo-title {
    margin-left: 10px;
    color: #fff;
    font-weight: 600;
    line-height: 50px;
    font-size: 16px;
    white-space: nowrap;
  }
}

::v-deep .el-input-group__append {
  background-color: #fff;
  padding: 0 !important;
  width: 39px !important;
  padding-left: 10px;

  .el-button {
    margin: -10px 0 !important;
  }
}
</style>
