HarmonyOS CJCalendar 日历组件无法编译

日历组件无法编译,报大量错误,使用方式如下:

CJCalendar({ 
  // 范围选择 
  optMode: OptMode.RANGE, 
  // 修改主题色 
  todayFontColor: "#E64A19", 
  // 开始日期 
  startDate: new Date(2024, 2, 3), 
  // 截止日期 
  endDate: new Date(2024, 2, 20), 
  // 日期选择变化监听 
  onDateChange: () => { 
  }, 
})
ERROR: ArkTS:ERROR File: D:\huawei\workspace\HarmonyBank\oh_modules\.ohpm\cxxxdar@1.1.8\oh_modules\cxxxdar\src\main\ets\components\cxxxdar\cxxxdar.ets:238:3 
BuilderParam property can only initialized by Builder function. 
ERROR: ArkTS:ERROR File: D:\huawei\workspace\HarmonyBank\oh_modules\.ohpm\cxxxdar@1.1.8\oh_modules\cxxxdar\src\main\ets\components\cxxxdar\cxxxdar.ets:241:3 
BuilderParam property can only initialized by Builder function. 
ERROR: ArkTS:ERROR File: D:\huawei\workspace\HarmonyBank\oh_modules\.ohpm\cxxxdar@1.1.8\oh_modules\cxxxdar\src\main\ets\components\cxxxdar\cxxxdar.ets:247:3 
BuilderParam property can only initialized by Builder function. 
ERROR: ArkTS:ERROR File: D:\huawei\workspace\HarmonyBank\oh_modules\.ohpm\cxxxdar@1.1.8\oh_modules\cxxxdar\src\main\ets\components\cxxxdar\cxxxdar.ets:254:3 
BuilderParam property can only initialized by Builder function. 
ERROR: ArkTS:ERROR File: D:\huawei\workspace\HarmonyBank\oh_modules\.ohpm\cxxxdar@1.1.8\oh_modules\cxxxdar\src\main\ets\components\cxxxdar\cxxxdar.ets:676:3 
BuilderParam property can only initialized by Builder function. 
ERROR: ArkTS:ERROR File: D:\huawei\workspace\HarmonyBank\oh_modules\.ohpm\cxxxdar@1.1.8\oh_modules\cxxxdar\src\main\ets\components\cxxxdar\cxxxdar.ets:699:3 
BuilderParam property can only initialized by Builder function. 
ERROR: ArkTS:ERROR File: D:\huawei\workspace\HarmonyBank\oh_modules\.ohpm\cxxxdar@1.1.8\oh_modules\cxxxdar\src\main\ets\components\cxxxdar\cxxxdar.ets:701:3 
BuilderParam property can only initialized by Builder function. 
ERROR: ArkTS:ERROR File: D:\huawei\workspace\HarmonyBank\oh_modules\.ohpm\cxxxdar@1.1.8\oh_modules\cxxxdar\src\main\ets\components\cxxxdar\cxxxdar.ets:705:3 
BuilderParam property can only initialized by Builder function. 
ERROR: ArkTS:ERROR File: D:\huawei\workspace\HarmonyBank\oh_modules\.ohpm\cxxxdar@1.1.8\oh_modules\cxxxdar\src\main\ets\components\cxxxdar\cxxxdar.ets:709:3 
BuilderParam property can only initialized by Builder function. 
ERROR: ArkTS:ERROR File: D:\huawei\workspace\HarmonyBank\oh_modules\.ohpm\cxxxdar@1.1.8\oh_modules\cxxxdar\src\main\ets\components\cxxxdar\cxxxdar.ets:713:3 
BuilderParam property can only initialized by Builder function. 
ERROR: ArkTS:ERROR File: D:\huawei\workspace\HarmonyBank\oh_modules\.ohpm\cxxxdar@1.1.8\oh_modules\cxxxdar\src\main\ets\components\cxxxdar\cxxxdar.ets:715:3 
BuilderParam property can only initialized by Builder function. 
ERROR: ArkTS:ERROR File: D:\huawei\workspace\HarmonyBank\oh_modules\.ohpm\cxxxdar@1.1.8\oh_modules\cxxxdar\src\main\ets\components\cxxxdar\cxxxdar.ets:721:3 
BuilderParam property can only initialized by Builder function. 
ERROR: ArkTS:ERROR File: D:\huawei\workspace\HarmonyBank\oh_modules\.ohpm\cxxxdar@1.1.8\oh_modules\cxxxdar\src\main\ets\components\cxxxdar\cxxxdar.ets:723:3 
BuilderParam property can only initialized by Builder function.
HarmonyOS
2024-09-12 12:06:21
浏览
收藏 0
回答 1
待解决
回答 1
按赞同
/
按时间
put_get

API10增加了限制:@BuilderParam只能被@Builder方法初始化。避免方法中增加了与UI构造不相关的业务逻辑。处理意见及解决措施:@Builder方法直接给@BuilderParam修饰对象复制。

1. 该库为外部个人开发者开发维护,在HarmonyOS版本上存在兼容问题,在仓库地址中https://atomgit.com/cj-open/CJOpen/issues,已经另有开发者提出了BuilderParam property can only initialized by Builder function.该问题,并且在其他issues中贴出了交流群,如有问题可联系该个人开发者。

2. 建议使用HarmonyOS官方的Calender Kit:https://developer.huawei.com/consumer/cn/doc/harmonyos-references-V5/js-apis-calendarmanager-V5

分享
微博
QQ
微信
回复
2024-09-12 17:31:45
相关问题
HarmonyOS 日历相关组件
430浏览 • 1回复 待解决
HarmonyOS日历组件吗?
440浏览 • 1回复 待解决
HarmonyOS 希望官方提供日历组件
282浏览 • 1回复 待解决
HarmonyOS 月视图模式的日历组件参考
55浏览 • 1回复 待解决
HarmonyOS 日历里面添加日历问题
19浏览 • 1回复 待解决
是否提供日历组件,你了解吗?
1822浏览 • 1回复 待解决
OpenHarmony dcts无法编译通过
3490浏览 • 0回复 待解决
HarmonyOS XCode 15.3无法编译flutter engine
79浏览 • 1回复 待解决
日历功能异常,getCalendar失败
476浏览 • 1回复 待解决
支持调试本地源码无法编译的so
716浏览 • 1回复 待解决
HarmonyOS web组件无法打开
47浏览 • 1回复 待解决
HarmonyOS Scroll组件无法滑动
470浏览 • 1回复 待解决
HarmonyOS 地图组件无法展示
184浏览 • 1回复 待解决
PA开发,如何添加日历提醒?
4100浏览 • 1回复 待解决
HarmonyOS 日期/日历/时间选择器开发
531浏览 • 1回复 待解决
HarmonyOS Tab组件无法响应onPageShow
489浏览 • 1回复 待解决
系统日历方法使用会抛异常
449浏览 • 0回复 待解决