This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!-- | |
| 场景:有一个纯js实现的第三方组件A,我需要在在这个组件中的某个dom位置注入一个elment-ui的popover组件。 | |
| 但是,这个组件A没有提供一个方式可以直接注入vue组件。它值提供了通过字符串配置方式是注入原生的html标签。 | |
| 因此,就使用el-popover组件的虚拟触发的方式 | |
| --> | |
| <ExpandMultiLevelPopover | |
| virtual-triggering | |
| :virtual-ref="expandMultiLevelPopoverRef" | |
| :[expandMultiLevelPopoverVisible]="true" | |
| @popoverHide="expandMultiLevelPopoverRef = null" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!-- 有这样一个结构 --> | |
| <div class="wrapper"> | |
| <div>筛选条件区</div> | |
| <div class="tb-wrap"> | |
| <!-- 表格区,可以是el-table或者vxe-table --> | |
| <el-table></el-table> | |
| <!-- 或者 --> | |
| <vxe-table></vxe-table> | |
| </div> | |
| </div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 原函数: | |
| const calcEndDate = (start: string, duration: number) => { | |
| const settedWorkdaysValue = settedWorkdays.value.map(item => { | |
| return WEEK_DATE_VALUE[item] | |
| }) | |
| let diff = 0 | |
| let curDay = dayjs(start).subtract(1, 'day') | |
| while (diff < duration) { | |
| curDay = curDay.add(1, 'day') | |
| if (settedWorkdaysValue.includes(curDay.day())) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| 1. 海思Hi-IPD及项目管理数字化平台 | |
| 为项目管理核心角色PM/QA/PL等提供作业与运营服务,实现角色一站式作战 | |
| 提供半导体场景化的需求管理、计划管理、任务管理、会议管理、角色看板等服务 | |
| 打通上下游系统,实现数字化执行流程,实现指令下得去、结果上得来的高效项目管理 | |
| 2. 海思会议管理数字化平台 | |
| 面向海思重量级团队DCP决策会议、项目会议、通用会议,提供会前、会中、 | |
| 会后端到端的线上管理服务 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| n年前的一个项目,npm install时,.npmrc中的registry=a.com | |
| 那么生成的package-lock.json锁文件将每个包的下载地址和版本锁定到其中的resolved字段 | |
| n年中,我们更新了.npmrc文件的registry=b.com,陆陆续续也升级了大多数包,那么这部分包在lock文件中的resolved字段也更新到新的b.com, | |
| 有一天a.com下线,因此已经无法从中下载包了,导致我们流水线在install的这一步会报错,因为有些包由于lock锁文件的原因还是从a.com中下载包 | |
| 解决:在本地先执行 npm uninstall 包X | |
| 再执行npm install 包X@原来的版本 | |
| 这样就可以更新lock锁文件中此包的resolved字段 | |
| 这样流水线执行时会从新地址下载包 | |
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| popover打开时,给它的trigger元素增加一个特殊的class类名 | |
| 某个元素的scroll事件需要关闭这个popover | |
| 那么在滚动事件中,document获取这个trigger的元素,触发它的click() | |
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| $textarea.focus(); | |
| $textarea.value = res?.data?.remark ?? ''; | |
| 先获取焦点 | |
| 再赋值 | |
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| 场景:scroll事件中要去设置一个css变量,来控制某些元素的定位位置, | |
| xxx.addEventListener('scroll', () => { | |
| const scrollY = xxx.scrollY; | |
| document.documentElement.style.setProperty('--scroll-y', `${scrollY}px`); | |
| }); | |
| 可见,一股脑就把变量设置到document上了 | |
| scroll事件很容易造成性能问题 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!-- | |
| 场景: | |
| el-popover中的选项点击会触发modal弹窗, | |
| 需求是,用户在弹窗点击操作,而不会使el-popover关闭,让它一直处于打开状态,直到当弹窗关闭后, | |
| 用户的接下来的操作,就正常触发el-popover关闭 | |
| --> | |
| <!-- | |
| 方案1: | |
| el-popover的触发方式是manual |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| .grid-bg { | |
| border-radius: 2px; | |
| border-right: 1px solid #e5e5e5; | |
| border-bottom: 1px solid #e5e5e5; | |
| background-image: linear-gradient(to right, #e5e5e5 1px, transparent 1px), linear-gradient(#e5e5e5 1px, transparent 1px); | |
| background-size: calc(8.333333%) var(--cell-height, 84px); | |
| } | |
| .grid-bg { | |
| margin: 0 auto; |
NewerOlder