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 日历相关组件
299浏览 • 1回复 待解决
HarmonyOS日历组件吗?
323浏览 • 1回复 待解决
HarmonyOS 希望官方提供日历组件
180浏览 • 1回复 待解决
是否提供日历组件,你了解吗?
1727浏览 • 1回复 待解决
OpenHarmony dcts无法编译通过
3356浏览 • 0回复 待解决
HarmonyOS 日期/日历/时间选择器开发
256浏览 • 1回复 待解决
日历功能异常,getCalendar失败
343浏览 • 1回复 待解决
HarmonyOS 地图组件无法展示
75浏览 • 1回复 待解决
HarmonyOS Scroll组件无法滑动
323浏览 • 1回复 待解决
PA开发,如何添加日历提醒?
3935浏览 • 1回复 待解决
JS如何添加日历日程提醒?
7827浏览 • 1回复 待解决
有没有调用日历的接口?
6235浏览 • 1回复 待解决
支持调试本地源码无法编译的so
658浏览 • 1回复 待解决
HarmonyOS Tab组件无法响应onPageShow
301浏览 • 1回复 待解决
系统日历方法使用会抛异常
350浏览 • 0回复 待解决
HarmonyOS TabContent无法套用在子组件
201浏览 • 1回复 待解决
如何跳转到系统的日历应用?
337浏览 • 1回复 待解决
HarmonyOS 跨module调用组件无法显示
142浏览 • 1回复 待解决
如何让日历显示的是农历日期?
586浏览 • 1回复 待解决
HarmonyOS Image组件无法显示网络图片
705浏览 • 1回复 待解决