-
Notifications
You must be signed in to change notification settings - Fork 159
New issue
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
refactor(popup): sfc to tsx #1401
base: develop
Are you sure you want to change the base?
Conversation
98f0848
to
11980ed
Compare
src/popup/popup.tsx
Outdated
@@ -31,21 +17,25 @@ let lockTimes = 0; | |||
|
|||
export default defineComponent({ | |||
name, | |||
components: { TNode, TOverlay }, | |||
inheritAttrs: false, | |||
props: popupProps, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import props from './props';
这里简写~
test 挂了,有空继续关注一下哦~ |
@anlyyao 功能没有问题,不止 |
cb5832b
to
f31b365
Compare
/update-snapshot |
⏳ 正在运行快照更新。。。 CI: Open |
测试案例没过需要处理下 �[7m FAIL �[27m src/action-sheet/__test__/index.test.jsx�[2m > ActionSheet�[2m > props�[2m > visible
AssertionError: expected true to be falsy
- Expected
+ Received
- false
+ true
�[2m❯ src/action-sheet/__test__/index.test.jsx:�[2m116:57
114| },
115| });
116| expect(wrapper.find(`.${prefix}-popup`).exists()).toBeFalsy();
| ^
117| await wrapper.setProps({
118| visible: true,
�[2m⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/1]⎯ |
f3517b4
to
266b693
Compare
src/popup/popup.tsx
Outdated
@@ -133,7 +112,7 @@ export default defineComponent({ | |||
|
|||
useLockScroll(popupRef, () => wrapperVisible.value && props.preventScrollThrough, popupClass.value); | |||
|
|||
return { | |||
context.expose({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
expose 是为了?
src/popup/popup.tsx
Outdated
|
||
const renderPopupContent = | ||
process.env.NODE_ENV === 'production' ? ( | ||
<Teleport to={to.value} disabled={!to.value}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
可以直接用useTeleport()
src/popup/popup.tsx
Outdated
import { getAttach } from '../shared/dom'; | ||
import { usePrefixClass } from '../hooks/useClass'; | ||
import { useLockScroll } from '../hooks/useLockScroll'; | ||
import { useContent, useTNodeJSX } from '@/hooks/tnode'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
用相对路径,别名打包会有问题
266b693
to
158030f
Compare
🤔 这个 PR 的性质是?
🔗 相关 Issue
💡 需求背景和解决方案
📝 更新日志
refactor(Popup):
sfc
totsx
本条 PR 不需要纳入 Changelog
☑️ 请求合并前的自查清单