应将变量名 PieGraphLayout
改写为 pieGraphLayout
,即采用驼峰命名法,符合 eslint@typescript-eslint/naming-convention 规范。示例代码如下:
interface PieChartProps {
pieGraphLayout: string;
// other props
}
function renderPieChart(props: PieChartProps) {
// access the prop using camelCase
console.log(props.pieGraphLayout);
}
上一篇:变量名转为字符串,R
下一篇:变量模板的模板特化和类型推断