我在将MeteorJS插入值到可编辑表方面遇到了这个问题。每当我插入一个值并调用模糊事件处理程序(对db执行更新操作)时,表单元格中的值就会显示两次。

我在以下位置有可用的代码:https://github.com/jeffrey-effendy/sudolver

谢谢您的帮助!

最佳答案

我在contenteditable领域经历了类似的事情。考虑其原因是因为值保留在单元格中,但是{{value}}也添加了一个值,因此其显示两次。

您可以通过先清除单元格来修复它:

Template.createCell.events({
    "blur .cell": function(e) {
       var val = $(e.currentTarget).text();
       $(e.currentTarget).text('');
       Meteor.call("update", this._id, val);
    }
});

关于javascript - MeteorJS:表中的输入值显示两次,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/30255427/

10-10 22:04