如何在foo
下方注释BAR
和ExampleClass
?
class ExampleClass {
private foo = {
one: 1,
two: 2
};
private static BAR = {
one: 'one',
two: 'three'
}
}
重要的案例:
文本版本:
import { Vue, Component, Prop } from 'vue-property-decorator';
@Component
export default class Bootstrap4AlertsCodeGenerator extends Vue {
static CONTEXT_CSS_CLASSES: object = {
PRIMARY: 'primary',
SECONDARY: 'secondary',
SUCCESS: 'success',
};
contextCssClass: string = Bootstrap4AlertsCodeGenerator.CONTEXT_CSS_CLASSES.SECONDARY;
public get isSelectContextCssClassRadiobuttonActive(): (contextCssClass: string) => boolean {
return contextCssClass => this.contextCssClass === contextCssClass;
}
}
错误:
TS2339: Property 'SECONDARY' does not exist on type 'object'.