File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import Category from './Category/index.vue';
44import Tabs from './Tabs/index.vue' ;
55import RuleEmpty from './RuleEmpty/index.vue' ;
66
7- export function useComponent ( app : App < Element > ) {
7+ export default function useComponent ( app : App < Element > ) {
88 app . component ( 'ARCover' , Cover ) ;
99 app . component ( 'ARCategory' , Category ) ;
1010 app . component ( 'ARTabs' , Tabs ) ;
Original file line number Diff line number Diff line change 1+ import type { App } from 'vue' ;
2+
3+ export default function useDirective ( app : App ) {
4+ app . directive ( 'focus' , {
5+ mounted : ( el ) => el . focus ( )
6+ } ) ;
7+ }
Original file line number Diff line number Diff line change 11import { createApp } from 'vue' ;
22import App from './App.vue' ;
33import router from './router' ;
4- import { useComponent } from './components' ;
4+ import useComponent from './components' ;
5+ import useDirective from './directive' ;
56import './assets' ;
67import './plugins/vsc-ui' ;
78import './plugins/antd' ;
@@ -17,6 +18,7 @@ const app = createApp(App);
1718app . use ( router ) ;
1819app . use ( createPinia ( ) ) ;
1920useComponent ( app ) ;
21+ useDirective ( app ) ;
2022
2123router . beforeEach ( ( to , _from , next ) => {
2224 const { query, path } = to ;
Original file line number Diff line number Diff line change 1111 <!-- 加载 -->
1212 <a-spin v-if =" loading" :spinning =" loading" class =" h-full w-full items-center justify-center !flex" />
1313 <!-- 阅读区域 -->
14- <div ref =" contentRef" tabindex =" 0" class =" relative h-full flex flex-1 flex-col overflow-y-auto indent-2em outline-none sm:px-60" >
14+ <div ref =" contentRef" v-focus tabindex =" 0" class =" relative h-full flex flex-1 flex-col overflow-y-auto indent-2em outline-none sm:px-60" >
1515 <!-- 漫画 -->
1616 <template v-if =" contentType === ContentType .MANGA " >
1717 <img v-for =" (row, idx) in content" :key =" idx" :src =" row" />
Original file line number Diff line number Diff line change 66 <div
77 id =" text-container"
88 ref =" contentRef"
9+ v-focus
910 tabindex =" 0"
1011 class =" flex-1 overflow-y-auto whitespace-pre-wrap break-words p-10 indent-2em lh-1.5em outline-none"
1112 :style =" {
You can’t perform that action at this time.
0 commit comments