I am writing a vue logger plugin
export default new (class NestLogger {
public install(Vue: any) {
Vue.prototype.$log = this;
}
error(text: string) {
console.log(text)
}
})();
in main.ts
import logger from "./plugins/logger";
Vue.use(logger);
But in components I cannot reference this.$log
- why?
In Login.vue
this.$log.error("bla");
Error: Property $log does not exist on type Login