【发布时间】:2026-01-19 21:45:01
【问题描述】:
我在使用 Meteor.js 中的反应式会话时遇到问题。
演示:Meteor Pad
Template.rows.helpers({
'rows': function () {
return Session.get('rows'); // data set in Session
}
});
Template.count.events({
'click .mdl-radio__button': function (e) {
// target represents a number of selected rows (1, 2, 5, or 10)
var value = $(e.currentTarget).val();
Session.set('limit', value);
},
'click #reset': function () {
Session.set('limit', 0);
Session.set('rows', null);
},
'click #run': function () {
// should only get rows when run() is pressed
Session.set('rows', currentItems);
}
});
用户应该能够选择要接收的新集合数量,由限制控制。但是,我不断收到以下错误:
Error: Match error: Failed Match.OneOf or Match.Optional validation
任何想法为什么?有人可以给我看一个可以运行的 MeteorPad 演示吗?
【问题讨论】:
标签: meteor meteor-blaze