ts2339错误:类型{}上不存在属性“xxx“

错误书写:

const json = {};
json.TASK = "z";

错误日志:

error TS2339: Property 'TASK' does not exist on type '{}'.

678           json.TASK = "z";

正确书写:

const json:any = {};
json.TASK = "z";

你可能感兴趣的:(json)