0
我有一個自動窗體與此選項:沒有收到文件_id作爲自動窗體方法更新參數
{{
#autoForm
collection=articulosColecction
id="articulos_modificar"
doc=articuloToModificar
type="method-update"
meteormethod="areas.update"
singleMethodArgument=true // Recommended here
}}
singleMethodArgument = TRUE推薦here
而且我的方法是這樣的:
export const update = new ValidatedMethod({
name: 'areas.update',
validate: null,
run(doc) {
console.log(doc._id);
Areas.update({ _id: doc._id }, doc.modifier)
}
});
- 如果將singleMethodArgument = true設置爲表單屬性,則將使用具有_id和修飾符屬性的單個對象參數調用您的方法。你應該這樣做,如果使用mdg:validated-method包。
但是console.log(doc._id);
正在輸出undefined
和我試圖`的console.log(DOC)」,並將其輸出僅修改器對象。
這是怎麼回事?我的AutoForm有問題嗎?
我在'autoForm'表單的'collection'參數上有錯誤的集合。 –