@@ -80,37 +80,50 @@ export default defineComponent({
8080 const inputRef = ref ();
8181 const { dataSource } = useMenus ();
8282 const menuItems = computed (() => {
83- return dataSource .value
84- .filter (i => i .order > - 1 )
85- .map (group => {
86- const components = group .children .filter (
87- (component : any ) =>
88- ! search .value .trim () ||
89- component .title .toLowerCase ().includes (search .value .trim ().toLowerCase ()) ||
90- (component .subtitle || ' ' ).toLowerCase ().includes (search .value .trim ().toLowerCase ()),
91- );
92- return { ... group , children: components };
93- })
94- .filter (i => i .children .length )
95- .concat ([
96- {
97- children: [
98- {
99- category: ' Components' ,
100- cols: 1 ,
101- cover: ' https://gw.alipayobjects.com/zos/alicdn/f-SbcX2Lx/Table.svg' ,
102- path: ' https://surely.cool/' ,
103- subtitle: ' 更强大的表格' ,
104- title: ' Powerful Table' ,
105- type: ' Advanced And Powerful' ,
106- target: ' _blank' ,
107- },
108- ],
109- enTitle: ' Advanced And Powerful' ,
110- title: ' 更强大' ,
111- order: 0 ,
112- },
113- ]);
83+ return [
84+ {
85+ children: [
86+ {
87+ category: ' Components' ,
88+ cols: 1 ,
89+ cover: ' https://gw.alipayobjects.com/zos/alicdn/f-SbcX2Lx/Table.svg' ,
90+ path: ' https://surely.cool/' ,
91+ subtitle: ' 更强大的表格' ,
92+ title: ' Surely Table' ,
93+ type: ' Advanced And Powerful' ,
94+ target: ' _blank' ,
95+ },
96+ {
97+ category: ' Components' ,
98+ cols: 1 ,
99+ cover: ' https://aliyuncdn.antdv.com/form/static/assets/landing-config.4f9d5425.png' ,
100+ path: ' https://form.antdv.com/' ,
101+ subtitle: ' 在线表单' ,
102+ title: ' Surely Form' ,
103+ type: ' Advanced And Powerful' ,
104+ target: ' _blank' ,
105+ },
106+ ],
107+ enTitle: ' Advanced And Powerful' ,
108+ title: ' 更强大' ,
109+ order: 0 ,
110+ },
111+ ].concat (
112+ dataSource .value
113+ .filter (i => i .order > - 1 )
114+ .map (group => {
115+ const components = group .children .filter (
116+ (component : any ) =>
117+ ! search .value .trim () ||
118+ component .title .toLowerCase ().includes (search .value .trim ().toLowerCase ()) ||
119+ (component .subtitle || ' ' )
120+ .toLowerCase ()
121+ .includes (search .value .trim ().toLowerCase ()),
122+ );
123+ return { ... group , children: components };
124+ })
125+ .filter (i => i .children .length ),
126+ );
114127 });
115128 onMounted (() => {
116129 inputRef .value .focus ();
0 commit comments