In a fresh new project created with Vue cli 3.3.0;
App.tsx
import Vue, { CreateElement } from 'vue';
import { Component } from 'vue-property-decorator';
@Component
export default class App extends Vue {
get isSideNavHidden(): boolean {
return false;
}
render(h: CreateElement) {
const sideNav = this.isSideNavHidden ? '' : (
<div id='nav'>
<router-link to='/'>Client list</router-link>
</div>
);
return (
<div id='app'>
{sideNav}
<router-view />
</div>
);
}
}
I'm getting the warning: The class method 'render' must be marked either 'private', 'public', or 'protected'.
Adding a "public" in front of the method resolves the issue, but I though public was implicit with typescript, like in the tsx file in the "exemple" project.
This is likely caused by your linter. Please check your linter config.
https://palantir.github.io/tslint/rules/member-access/
@ktsn - True, this is caused by the linter, but is there any guidance for linter settings for Vue projects written in the style(s) of the default App template?
add "member-access": [true, "no-public"] or "member-access": false in rules of your tslint.json
Most helpful comment
add "member-access": [true, "no-public"] or "member-access": false in rules of your tslint.json