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.
This commit is contained in:
undergroundwires
2021-04-19 18:21:06 +02:00
parent 8141a01ef7
commit b25b8cc805

View File

@@ -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();