I am learning TypeScript and Vue.js.
I have come across a Vue theme that starts with @
on many lines.
What does it do exactly? Is this TypeScript, Javascript or Vue thing?
For example, in one of the Vue store module TypeScript files it looks like this (some code removed for brevity):
@Module
export default class BodyModule extends VuexModule implements StoreInfo {
classes = {};
@Mutation
[Mutations.SET_CLASSNAME_BY_POSITION](payload) {
const { position, className } = payload;
if (!this.classes[position]) {
this.classes[position] = [];
}
this.classes[position].push(className);
}
@Action
[Actions.ADD_BODY_CLASSNAME](className) {
document.body.classList.add(className);
}
}
Many of those lines such as @Module
, @Mutation
, and @Action
start with with the @
symbol.
I have not seen this many times before.
What does it do exactly?
It looks like a comment of sorts to me. If that is the case, why not use //
instead?