File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11<template >
22 <div class =" setting-search" :class =" { focus: isFocus }" >
33 <n-input
4+ ref =" inputInst"
45 v-model:value =" inputValue"
56 clearable
67 placeholder =" 搜索设置项..."
3637</template >
3738
3839<script setup lang="ts">
39- import type { SelectOption } from " naive-ui" ;
40+ import { SelectOption , NInput } from " naive-ui" ;
4041import Fuse from " fuse.js" ;
4142
4243interface SearchOption extends SelectOption {
@@ -51,6 +52,7 @@ const props = defineProps<{
5152
5253const emit = defineEmits ([" select" , " active-change" ]);
5354
55+ const inputInst = ref <InstanceType <typeof NInput > | null >(null );
5456const inputValue = ref (" " );
5557const isFocus = ref (false );
5658const resultList = ref <SearchOption []>([]);
@@ -88,7 +90,7 @@ watch(inputValue, (val) => {
8890
8991// 处理失焦
9092const handleBlur = () => {
91- // isFocus.value = false;
93+ isFocus .value = false ;
9294};
9395
9496// 处理选择
@@ -97,6 +99,7 @@ const handleSelect = (value: string | number) => {
9799 isFocus .value = false ;
98100 inputValue .value = " " ;
99101 emit (" active-change" , false );
102+ inputInst .value ?.blur ();
100103};
101104 </script >
102105
Original file line number Diff line number Diff line change 1414:root {
1515 // 图片模式
1616 & .image {
17- --background-hex : rgba (0 , 0 , 0 , 0.2 ) !important ;
18- --surface-container-hex : rgba (0 , 0 , 0 , 0.1 ) !important ;
17+ --background-hex : rgba (0 , 0 , 0 , 0.1 ) !important ;
18+ --surface-container-hex : rgba (0 , 0 , 0 , 0.2 ) !important ;
1919 body {
2020 --background-hex : rgba (var (--background ), 0.1 ) !important ;
21- --surface-container-hex : rgba (var (--surface-container ), 0.1 ) !important ;
21+ --surface-container-hex : rgba (var (--surface-container ), 0.2 ) !important ;
2222 --n-toggle-bar-color : rgba (var (--background ), 0.2 ) !important ;
2323 --n-toggle-bar-color-hover : rgba (var (--background ), 0.4 ) !important ;
2424 }
2525 .n-layout-sider {
26- background-color : rgba ( var (--surface-container ), 0.2 ) !important ;
26+ background-color : var (--surface-container-hex ) !important ;
2727 }
2828 .n-layout {
2929 background-color : transparent !important ;
3030 }
3131 .main-player {
3232 background-color : var (--surface-container-hex );
33- backdrop-filter : blur (20 px );
33+ backdrop-filter : blur (10 px );
3434 }
3535 // 内置组件
3636 .n-card ,
You can’t perform that action at this time.
0 commit comments