@@ -6,7 +6,7 @@ import { colorTheme } from './composables/theme'
66
77export default {
88 name: ' App' ,
9- data () {
9+ data () {
1010 return {
1111 locale: zhCN,
1212 info: {},
@@ -18,22 +18,22 @@ export default {
1818 }
1919 },
2020 computed: {
21- themeClass () {
21+ themeClass () {
2222 return ` theme-${ colorTheme .value } `
2323 },
24- theme () {
24+ theme () {
2525 return colorTheme .value
2626 },
2727 },
28- mounted () {
28+ mounted () {
2929 let theme = this .config .app .theme
3030 if (this .config .app .theme === ' system' ) {
3131 theme = window .matchMedia (' (prefers-color-scheme: dark)' ).matches ? ' dark' : ' light'
3232 }
3333
3434 colorTheme .value = theme
3535 },
36- created () {
36+ created () {
3737 this .menus = createMenus (this )
3838 this .config = this .$global .config
3939 this .$api .info .get ().then ((ret ) => {
@@ -91,19 +91,19 @@ export default {
9191 })
9292 },
9393 methods: {
94- getSearchBarInput () {
94+ getSearchBarInput () {
9595 return this .$refs .searchBar .$el .querySelector (' input[type=text]' )
9696 },
97- onSearchBarInputFocus () {
97+ onSearchBarInputFocus () {
9898 this .searchBarIsFocused = true
9999 },
100- onSearchBarInputBlur () {
100+ onSearchBarInputBlur () {
101101 this .searchBarIsFocused = false
102102 },
103- onSearchBarInputKeydown () {
103+ onSearchBarInputKeydown () {
104104 clearTimeout (this .searchBarInputKeyupTimeout )
105105 },
106- onSearchBarInputKeyup (e ) {
106+ onSearchBarInputKeyup (e ) {
107107 if (! this .$refs .searchBar || e .key === ' Enter' || e .key === ' F3' ) {
108108 return
109109 }
@@ -114,23 +114,23 @@ export default {
114114 this .$refs .searchBar .previous ()
115115 }, 150 )
116116 },
117- doSearchBarInputFocus () {
117+ doSearchBarInputFocus () {
118118 setTimeout (() => {
119119 const input = this .getSearchBarInput ()
120120 if (input) {
121121 input .focus ()
122122 }
123123 }, 100 )
124124 },
125- titleClick (item ) {
125+ titleClick (item ) {
126126 console .log (' title click:' , item)
127127 },
128- menuClick (item ) {
128+ menuClick (item ) {
129129 console .log (' menu click:' , item)
130130 window .config .disableSearchBar = false
131131 this .$router .replace (item .path )
132132 },
133- async openExternal (url ) {
133+ async openExternal (url ) {
134134 await this .$api .ipc .openExternal (url)
135135 },
136136 },
@@ -140,26 +140,19 @@ export default {
140140<template >
141141 <a-config-provider :locale =" locale" >
142142 <div class =" ds_layout" :class =" themeClass" >
143- <SearchBar
144- ref =" searchBar"
145- root =" #document"
146- highlight-class =" search-bar-highlight"
147- selected-class =" selected-highlight"
148- :hiden.sync =" hideSearchBar"
149- style =" inset :auto auto 53px 210px ; background-color :#ddd "
150- />
143+ <SearchBar ref =" searchBar" root =" #document" highlight-class =" search-bar-highlight"
144+ selected-class =" selected-highlight" :hiden.sync =" hideSearchBar"
145+ style =" inset :auto auto 53px 210px ; background-color :#ddd " />
151146 <a-layout >
152147 <a-layout-sider :theme =" theme" style =" overflow-y : auto " >
153148 <div class =" logo" />
154149 <div class =" aside" >
155- <a-menu
156- mode =" inline"
157- :default-selected-keys =" [$route.fullPath]"
158- :default-open-keys =" ['/plugin']"
159- >
150+ <a-menu mode =" inline" :default-selected-keys =" [$route.fullPath]" :default-open-keys =" ['/plugin']" >
160151 <template v-for =" (item ) of menus " >
161- <a-sub-menu v-if =" item.children && item.children.length > 0" :key =" item.path" @titleClick =" titleClick(item)" >
162- <span slot =" title" ><a-icon :type =" item.icon ? item.icon : 'file'" /><span >{{ item.title }}</span ></span >
152+ <a-sub-menu v-if =" item.children && item.children.length > 0" :key =" item.path"
153+ @titleClick =" titleClick(item)" >
154+ <span slot =" title" ><a-icon :type =" item.icon ? item.icon : 'file'" /><span >{{ item.title
155+ }}</span ></span >
163156 <a-menu-item v-for =" (sub) of item.children" :key =" sub.path" @click =" menuClick(sub)" >
164157 <a-icon :type =" sub.icon ? sub.icon : 'file'" /> {{ sub.title }}
165158 </a-menu-item >
@@ -179,7 +172,9 @@ export default {
179172 </a-layout-content >
180173 <a-layout-footer >
181174 <div class =" footer" >
182- ©2020-2025 docmirror.cn by <a @click =" openExternal('https://github.com/greper')" >Greper</a >, <a @click =" openExternal('https://github.com/wangliang181230')" >WangLiang</a >, <a @click =" openExternal('https://github.com/cute-omega')" >CuteOmega</a > <span >{{ info.version }}</span >
175+ ©2020-2026 docmirror.cn by <a @click =" openExternal('https://github.com/greper')" >Greper</a >, <a
176+ @click =" openExternal('https://github.com/wangliang181230')" >WangLiang</a >, <a
177+ @click =" openExternal('https://github.com/cute-omega')" >CuteOmega</a > <span >{{ info.version }}</span >
183178 </div >
184179 </a-layout-footer >
185180 </a-layout >
@@ -192,21 +187,26 @@ export default {
192187body {
193188 height : 100% ;
194189}
190+
195191.ds_layout {
196192 font-family : Avenir, Helvetica , Arial , sans-serif ;
197193 -webkit-font-smoothing : antialiased ;
198194 -moz-osx-font-smoothing : grayscale ;
199195 color : #2c3e50 ;
200196 height : 100% ;
197+
201198 .ant-layout-has-sider {
202199 border : 1px solid #eee ;
203200 }
201+
204202 .ant-layout-sider-children {
205203 border-right : 1px solid #eee ;
206204 }
205+
207206 .ant-layout {
208207 height : 100% ;
209208 }
209+
210210 .logo {
211211 padding : 5px ;
212212 border-bottom : #eee solid 1px ;
@@ -216,17 +216,20 @@ body {
216216 background-repeat : no-repeat ;
217217 background-position : 5px center ;
218218 }
219+
219220 .ant-layout-footer {
220221 padding : 10px ;
221222 text-align : center ;
222223 border-top : #d6d4d4 solid 1px ;
223224 }
225+
224226 .ant-menu-inline ,
225227 .ant-menu-vertical ,
226228 .ant-menu-vertical-left {
227229 border : 0 ;
228230 }
229231}
232+
230233.search-bar-highlight {
231234 background-color : #ef0fff ;
232235 color : #fdfdfd ;
0 commit comments