Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
如图,礼花的位置没有从页面最顶层开始播放
出现问题的原因是当前绘制礼花的
canvas
定位是基于modal-box
层(之前是基于dialog
)导致整体绘制的大小位置发生了变更既然如此,那就尝试将礼花的绘制
canvas
的放到外面很快我们发现了一个新的问题,因为
dialog
的modal
类的z-index
值是 999,所以如果我们的canvas
不在modal
内的话,播放礼花就只能在背后显示了,大部分会被modal-box
实际显示的内容所遮盖对此,有两个解决方案
canvas
绘制,直接使用confetti
方法播放礼花,配置其参数z-index
高于modal
canvas
绘制不变,在canvas
上配置z-index
高于modal
为了不引起其他不必要的问题,这里选择第二种解决方案 😊