فهرست منبع

菜单搜索完善

lyy 1 سال پیش
والد
کامیت
87af931819
1فایلهای تغییر یافته به همراه31 افزوده شده و 4 حذف شده
  1. 31 4
      src/views/HomeView.vue

+ 31 - 4
src/views/HomeView.vue

@@ -1,12 +1,16 @@
-import { RouterView } from 'vue-router'
+
 <script lang="ts" setup>
+import { RouterView } from 'vue-router'
+import {ref} from 'vue'
 import {
   BellFilled,
   ArrowRightBold,
   Menu as IconMenu,
   Location,
   Setting,
+  Search
 } from '@element-plus/icons-vue'
+let searchWord=ref('')
 const handleOpen = (key: string, keyPath: string[]) => {
   console.log(key, keyPath)
 }
@@ -19,9 +23,18 @@ const handleClose = (key: string, keyPath: string[]) => {
 <template>
   <div class="common-layout">
     <el-container>
-      <el-aside width="200px">
+      <el-aside width="200px" style="background:#fff">
+        <div class="reset-ipt">
+          <el-input
+          
+          v-model="searchWord"
+          style="width: 100%"
+          placeholder="搜索菜单..."
+          :suffix-icon="Search"
+        />
+        </div>
         <el-menu
-        style="height:100%"
+       
         active-text-color="#ffd04b"
         background-color="#000000"
         class="el-menu-vertical-demo"
@@ -125,9 +138,23 @@ const handleClose = (key: string, keyPath: string[]) => {
   </div>
 </template>
 
+<style lang="scss">
+  .reset-ipt{
+    box-sizing: border-box;
+    background:#000;
+    padding:12px 16px;
+    .el-input__wrapper{
+      box-shadow: none;
+      background:#374151;
+    }
+  }
+</style>
 
 <style lang="scss"  scoped>
-
+  
+  .el-menu{
+    height:calc(100% - 56px);
+  }
   .common-layout{
     height:100%;
     .el-container{