From b25b8cc8052655af70b0695c6c3085974d783bb6 Mon Sep 17 00:00:00 2001 From: undergroundwires Date: Mon, 19 Apr 2021 18:21:06 +0200 Subject: [PATCH] fix vue warning for undefined property during render currentOs is not recognized as reactive property as it's set to "undefined". JavaScript does not accept "undefined" as valid value to initialize. A property needs to be initialized with a non-undefined value to become reactive in a class-based component. Otherwise Vue warns: Property or method "currentOs" is not defined on the instance but referenced during render. --- src/presentation/components/Scripts/Menu/TheOsChanger.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/presentation/components/Scripts/Menu/TheOsChanger.vue b/src/presentation/components/Scripts/Menu/TheOsChanger.vue index 6c3e2a49..2997060f 100644 --- a/src/presentation/components/Scripts/Menu/TheOsChanger.vue +++ b/src/presentation/components/Scripts/Menu/TheOsChanger.vue @@ -24,7 +24,7 @@ import { ApplicationFactory } from '@/application/ApplicationFactory'; @Component export default class TheOsChanger extends StatefulVue { public allOses: Array<{ name: string, os: OperatingSystem }> = []; - public currentOs?: OperatingSystem = undefined; + public currentOs?: OperatingSystem = null; public async created() { const app = await ApplicationFactory.Current.getAppAsync();