calendar异常-Cannot read property 'width' of undefined
- Dominant language
- TypeScript
- Stars
- 18.9k
- Forks
- 2.7k
- PR merge metrics
- No merged PRs in 30d
Description
js sdk 2.1.0/2.2.0 都有此问题
下面代码中schedules数组中测试数据 如果全部打开就异常 随便注释两个就正常了
calendar是对数据有啥要求吗
let amisJSON = {
"type": "page",
"body": [
{
"type": "form",
"target": "detailForm",
"wrapWithPanel": false,
"submitOnChange": true,
"mode": "inline",
"body": [
{
"name": "myself",
"type": "checkbox",
"label": false,
"option": "只看我自己的",
"trueValue": "1",
"falseValue": "0",
"disabled": true
},
{
"type": "button",
"actionType": "submit",
"icon": "fa fa-refresh",
}
]
},
{
"type": "service",
"name": "detailForm",
"api": "/IT/QueryCalendar?myself=${myself}",
"body": {
"type": "calendar",
//"value": "1638288000",
"largeMode": true,
//"schedules": "${schedules}",
"schedules": [
{
"startTime": "2022-08-30 00:00:00",
"endTime": "2022-09-05 23:59:59",
"content": "[计划] bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
"className": "bg-info"
},
{
"startTime": "2022-08-25 00:00:00",
"endTime": "2022-10-05 23:59:59",
"content": "[计划] OA重大事项跟踪需求",
"className": "bg-info"
},
{
"startTime": "2022-09-11 00:00:00",
"endTime": "2022-10-02 23:59:59",
"content": "[计划] 惆怅长岑长错错错错错错",
"className": "bg-info"
},
{
"startTime": "2022-09-08 00:00:00",
"endTime": "2022-09-11 23:59:59",
"content": "[计划] 呃呃呃呃呃呃呃呃呃呃呃呃鹅鹅鹅鹅鹅鹅饿",
"className": "bg-info"
}
],
"onEvent": {
"change": {
"actions": [
{
"actionType": "custom",
"script": function (context, doAction, event) {
console.log(event);
}
}
]
}
},
}
}
]
}
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reproducing the supplied calendar configuration in JS SDK versions 2.1.0 and 2.2.0 with all four schedules enabled, then inspect the calendar component and the reported width error. Done means the configuration no longer throws the exception and all supplied schedules render, or the required schedule constraints are documented.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 40/100