收藏
回答

在Typescript环境下使用的Promise

https://developers.weixin.qq.com/miniprogram/dev/extended/utils/api-promise.html

有没有在Typescript环境下使用的Promise?按教程npm install后再import时报错

{

"resource": "/C:/Users/whh/WeChatProjects/miniprogram-11/miniprogram/app.ts",

"owner": "typescript",

"code": "7016",

"severity": 8,

"message": "无法找到模块“miniprogram-api-promise”的声明文件。“c:/Users/whh/WeChatProjects/miniprogram-11/node_modules/miniprogram-api-promise/src/index.js”隐式拥有 \"any\" 类型。\n  Try `npm install @types/miniprogram-api-promise` if it exists or add a new declaration (.d.ts) file containing `declare module 'miniprogram-api-promise';`",

"source": "ts",

"startLineNumber": 2,

"startColumn": 41,

"endLineNumber": 2,

"endColumn": 66

}

回答关注问题邀请回答
收藏

2 个回答

登录 后发表内容
问题标签