File tree Expand file tree Collapse file tree 2 files changed +6
-13
lines changed Expand file tree Collapse file tree 2 files changed +6
-13
lines changed Original file line number Diff line number Diff line change 163163<script setup lang="ts">
164164import { inject , ref } from " vue" ;
165165import { QInput } from " quasar" ;
166- import {
167- DictionaryManageDialogContext ,
168- dictionaryManageDialogContextKey ,
169- } from " ./DictionaryManageDialog.vue" ;
166+ import { dictionaryManageDialogContextKey } from " ./DictionaryManageDialog.vue" ;
170167import AudioAccent from " @/components/Talk/AudioAccent.vue" ;
171168import ContextMenu from " @/components/Menu/ContextMenu/Container.vue" ;
172169import { useRightClickContextMenu } from " @/composables/useRightClickContextMenu" ;
@@ -175,9 +172,7 @@ import type { FetchAudioResult } from "@/store/type";
175172
176173const store = useStore ();
177174
178- const context = inject <DictionaryManageDialogContext >(
179- dictionaryManageDialogContextKey ,
180- );
175+ const context = inject (dictionaryManageDialogContextKey );
181176if (context == undefined )
182177 throw new Error (` dictionaryManageDialogContext == undefined ` );
183178const {
Original file line number Diff line number Diff line change 124124</template >
125125
126126<script lang="ts">
127- import { Ref , ComputedRef } from " vue" ;
127+ import { Ref , ComputedRef , type InjectionKey } from " vue" ;
128128
129- export const dictionaryManageDialogContextKey = " dictionaryManageDialogContext" ;
130-
131- export interface DictionaryManageDialogContext {
129+ export const dictionaryManageDialogContextKey: InjectionKey <{
132130 wordEditing: Ref <boolean >;
133131 surfaceInput: Ref <QInput | undefined >;
134132 selectedId: Ref <string >;
@@ -153,7 +151,7 @@ export interface DictionaryManageDialogContext {
153151 toInitialState: () => void ;
154152 toWordEditingState: () => void ;
155153 cancel: () => void ;
156- }
154+ }> = Symbol ( " dictionaryManageDialogContextKey " );
157155 </script >
158156
159157<script setup lang="ts">
@@ -426,7 +424,7 @@ const toDialogClosedState = () => {
426424 dictionaryManageDialogOpenedComputed .value = false ;
427425};
428426
429- provide < DictionaryManageDialogContext > (dictionaryManageDialogContextKey , {
427+ provide (dictionaryManageDialogContextKey , {
430428 wordEditing ,
431429 surfaceInput ,
432430 selectedId ,
You can’t perform that action at this time.
0 commit comments