现在有类似这样的代码mui(document).on("tap", ".delete", function() { console.log('mui(document).on("tap", ".delete")');
commentId = this.getAttribute('comment-id'); console.log(commentId);
deleteLetterComment(commentId);
});我想把这里面的function提出来复用。我知道可以这么写mui(document).on("tap", ".delete", beforeDeleteLetterComment);function beforeDeleteLetterComment() { console.log('mui(document).on("tap", ".delete")');
commentId = this.getAttribute('comment-id'); console.log(commentId);
deleteLetterComment(commentId);
}然而还有一段代码需要传递参数function beforesubmitComment(str){
}我想也这样用,但是直接写mui(document).on("tap",".delete",beforesubmitComment(str));不生效求助该怎么写。
添加回答
举报
0/150
提交
取消