From dec16cd3183d85e7a7ce842d695164d44e77897b Mon Sep 17 00:00:00 2001 From: Thomas Lehmann Date: Tue, 28 May 2024 18:40:20 +0200 Subject: [PATCH] AuthTokenSetup.vue: move data property definition *after* methods, fix one error (still fails) Merely moving the property after another fixes a Typescript error. I'm baffled. Still fails with two other errors where Typescript can't infer types on properties referenced via this.$refs. This fixes one of three Vue/Typescript errors: ERROR in /app/src/components/AuthTokenSetup.vue.ts 47:9-14 [tsl] ERROR in /app/src/components/AuthTokenSetup.vue.ts(47,10) TS2339: Property 'reset' does not exist on type 'CreateComponentPublicInstance<{}, { authTokenStore: Store<"auth-token", { tokens: IToken[]; }, {}, { updateToken(token: IToken): Promise; addToken(name: string): Promise; deleteToken(token: IToken): Promise<...>; wipeToken(token: IToken): Promise<...>; renameToken(token: IToken, newName: ...'. Related: * https://github.com/vuejs/vue/issues/12628#issuecomment-1283730746 --- src/components/AuthTokenSetup.vue | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/components/AuthTokenSetup.vue b/src/components/AuthTokenSetup.vue index d13403b..790b2f1 100644 --- a/src/components/AuthTokenSetup.vue +++ b/src/components/AuthTokenSetup.vue @@ -67,13 +67,6 @@ export default defineComponent({ const authTokenStore = useAuthTokenStore() return { authTokenStore } }, - data() { - return { - deviceName: '', - loading: false, - newToken: null as ITokenResponse|null, - } - }, methods: { t, reset() { @@ -94,6 +87,13 @@ export default defineComponent({ } }, }, + data() { + return { + deviceName: '', + loading: false, + newToken: null as ITokenResponse|null, + } + }, })