Error: Property 'createWithoutData' does not exist on type 'new () => FmodeObject'.
在FmodeParse中,不能使用标准Parse SDK的createWithoutData方法来创建Pointer对象。
// 标准Parse SDK方法(在FmodeParse中不可用)
Parse.Object.extend('Company').createWithoutData(companyId)
// FmodeParse中创建Pointer的正确方式
{
__type: 'Pointer',
className: 'Company',
objectId: companyId
}
// 修复前
private getCompanyPointer(): any {
return Parse.Object.extend('Company').createWithoutData(this.companyId);
}
// 修复后
private getCompanyPointer(): any {
return {
__type: 'Pointer',
className: 'Company',
objectId: this.companyId
};
}
// 修复前
private getProjectPointer(projectId: string): any {
return Parse.Object.extend('Project').createWithoutData(projectId);
}
// 修复后
private getProjectPointer(projectId: string): any {
return {
__type: 'Pointer',
className: 'Project',
objectId: projectId
};
}
// 修复前
if (goodsId) {
return Parse.Object.extend('ShopGoods').createWithoutData(goodsId);
}
// 修复后
if (goodsId) {
return {
__type: 'Pointer',
className: 'ShopGoods',
objectId: goodsId
};
}
FmodeParse中的Pointer对象使用以下JSON结构:
{
__type: 'Pointer', // 固定值,表示这是一个指针
className: 'TableName', // 目标表名
objectId: 'objectId123' // 目标对象ID
}
参考case.service.ts中的实现:
private getCompanyPointer() {
return {
__type: 'Pointer',
className: 'Company',
objectId: this.companyId
};
}
private getPointer(className: string, objectId: string) {
return {
__type: 'Pointer',
className,
objectId
};
}
yss-project/src/app/services/project-to-case.service.ts2025-10-29