typescript - 参数名称提示不适用于打字稿静态方法
问题描述
我有这Car
节课
export default class Car {
static totalCars = 0;
constructor(public name: string, public model: number) {
Car.totalCars++
}
static getReport = (template: string, lastCar : Car): string => {
return `${template} : ${Car.totalCars}, Last car created : ${lastCar.name}, ${lastCar.model}`;
}
}
当我尝试使用课程时
import Car from "./Car";
const bmw: Car = new Car("BMW", 2018);
const audi: Car = new Car("Audi", 2017);
console.log(Car.getReport('Total cars created: ', audi));
我没有得到静态方法 getReport
的参数提示。(它适用于构造函数和成员方法)
证明
解决方案
请尝试2018.2 EAP,我无法在那里重现该问题。并且不要忘记在Settings > Editor > General > Appearance > Show parameter name hints > Configure
.
推荐阅读
- azure - 使用新的服务器主要凭据更新 AKS 群集
- oracle - 我不明白的 PL/SQL 示例
- java - ClassNotFoundException:javax.xml.ws.Service
- python - (MissingClaimError) 使用 Praetorian 生成 JWT 令牌的 Python 烧瓶!str(uuid.uuid4()) 返回 null
- cmake - Cmake Ctest 仅检查子字符串
- http - 需要很长时间才能回复的 SOAP 请求 - 停止连接断开的任何想法
- python - 将 NamedTuple 转换为 dict 以用于字典解包 (**kwargs) 的 Pythonic 方式
- javascript - 如何在数组项的第二个对象中查找第一个数组项并从第二个对象返回匹配项
- machine-learning - 高效的 ROC/AUC 计算和时间复杂度
- google-apps-script - 如何避免在高级驱动器服务更改列表中重复显示相同的文件