Is there a way to implement enums in a Vue file?
I start by creating my enums in a JavaScript file
const Status= Object.freeze({
Normal: "normal",
Loading: "loading",
Error: "error",
Done: "done",
});
export default Status;
However, I encounter issues when trying to compile my main.vue file:
<template>
<div v-if="status == AudioCardStatus.Normal">
</template>
import Status from "./../enums/status"
The error message reads:
Property or method "Status" is not defined on the instance but referenced during render. Make sure that this property is reactive, either in the data option, or for class-based components, by initializing the property.
I have searched for solutions on platforms like Stack Overflow, such as this SO question, but they mostly recommend using Typescript.