We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
import React from 'react'; import { Calendar, RadioGroup, Radio } from '@douyinfe/semi-ui'; class Demo extends React.Component { constructor() { super(); this.state = { mode: 'week', }; } onSelect(e) { this.setState({ mode: e.target.value, }); } render() { const { mode } = this.state; const isMonthView = mode === 'month'; const dailyEventStyle = { borderRadius: '3px', boxSizing: 'border-box', border: 'var(--semi-color-primary) 1px solid', padding: '10px', backgroundColor: 'var(--semi-color-primary-light-default)', height: '100%', overflow: 'hidden', }; const allDayStyle = { borderRadius: '3px', boxSizing: 'border-box', border: 'var(--semi-color-bg-1) 1px solid', padding: '2px 4px', backgroundColor: 'var(--semi-color-primary-light-active)', height: '100%', overflow: 'hidden', }; const dailyStyle = isMonthView ? allDayStyle : dailyEventStyle; const events = [ { key: '6', start: new Date(2019, 6, 23, 8, 22, 0), end: new Date(2019, 6, 23, 8, 24, 0), children: <div style={dailyStyle}>7月23日 8:32</div>, }, { key: '7', start: new Date(2019, 6, 23, 8, 50, 0), end: new Date(2019, 6, 23, 8, 59, 0), children: <div style={dailyStyle}>7月23日 8:32</div>, }, ]; const displayValue = new Date(2019, 6, 23, 8, 32, 0); return ( <> <RadioGroup onChange={e => this.onSelect(e)} value={mode}> <Radio value={'day'}>日视图</Radio> <Radio value={'week'}>周视图</Radio> <Radio value={'month'}>月视图</Radio> <Radio value={'range'}>多日视图</Radio> </RadioGroup> <br /> <br /> <Calendar height={400} mode={mode} displayValue={displayValue} events={events} range={mode === 'range' ? [new Date(2019, 6, 23), new Date(2019, 6, 26)] : []} ></Calendar> </> ); } }
The text was updated successfully, but these errors were encountered:
有结论么?
Sorry, something went wrong.
我能想到的就是暂时这样处理了:
useEffect(() => { setTimeout(() => { const parentElements = document.querySelectorAll('.semi-calendar-event-item'); parentElements.forEach(parentElement => { parentElement.style.height = 'auto'; }); }, 1000) }, []);
目前考虑开放一个 api 让用户定义 minEventHeight,当计算出来的 event 高度小于 minEventHeight 时,将 style 赋值为 auto,否则就用计算出的 height 值。
顺利的话这个 feature 会跟下周一的版,同学可以先按照你的临时处理方案绕过一下。
support v2.49.0-beta.0
YannLynn
No branches or pull requests
Which Component 出现bug的组件
semi-ui version
Expected result 期望的结果是什么
Actual result 实际的结果是什么
Steps to reproduce 复现步骤
Reproducible code 复现代码
Additional information 补充说明
The text was updated successfully, but these errors were encountered: