【发布时间】:2018-11-23 07:15:29
【问题描述】:
当用户单击赞按钮以增加数字时,我有一个单击操作,但是在构建或运行 ionic 应用程序时,我遇到了打字稿错误,有人可以帮助我解决问题吗?
Typescript Error
An arithmetic operand must be of type 'any', 'number' or an enum type.
src/pages/comments/comments.ts
document.getElementById("like-" + commentid).innerHTML++
在 cmets.ts 中
likedislike(type,commentid) {
if(type === 'like') {
document.getElementById("like-" + commentid).innerHTML++
}
}
【问题讨论】:
-
您将在此处使用 angular.. 正确的方法是使用数据绑定
标签: typescript ionic-framework ionic3