Meteor.methods()函数究竟给出了什么?

时间:2016-05-03 18:52:20

标签: javascript meteor

看看这个示例代码:

Meteor.methods({
'tasks.insert'(text) {
    check(text, String);

    // and other stuff...
},
'tasks.remove'(taskId) {
    check(taskId, String);
    Tasks.remove(taskId);
},
});

methods()函数采用了js对象文字,但在该对象中你没有标准的名称 - 值对。为什么呢?

1 个答案:

答案 0 :(得分:1)

Creating an app页面所述,示例代码使用ECMAScript 2015功能。您提到的特定功能是增强的对象文字语法,其描述为here

相关问题