-
-
Notifications
You must be signed in to change notification settings - Fork 627
feat: new component tour #1875
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
base: dev
Are you sure you want to change the base?
feat: new component tour #1875
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@cszhjh is attempting to deploy a commit to the varletjs Team on Vercel. A member of the Team first needs to authorize it. |
@varlet/cli
@varlet/icons
@varlet/import-resolver
@varlet/preset-tailwindcss
@varlet/preset-unocss
@varlet/touch-emulator
@varlet/shared
@varlet/ui
@varlet/use
@varlet/vite-plugins
commit: |
function flattedChildren(subTree: any) { | ||
const vNodes: VNode[] = [] | ||
|
||
const flat = (subTree: any) => { | ||
if (subTree?.component) { | ||
flat(subTree?.component.subTree) | ||
return | ||
} | ||
|
||
if (isArray(subTree?.children)) { | ||
subTree.children.forEach((child: any) => { | ||
if (isVNode(child)) { | ||
vNodes.push(child) | ||
|
||
flat(child) | ||
} | ||
}) | ||
} | ||
} | ||
|
||
flat(subTree) | ||
|
||
return vNodes | ||
} |
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.
这个在 space 组件也有类似实现,最好是用同一个实现。
const total = result.length | ||
|
||
if (cacheTotal !== total) { | ||
emit('update-total', total) |
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.
最好是不要在渲染函数里 emit 事件,建议改成 useChildren useParent
} | ||
|
||
export const props = { | ||
open: Boolean, |
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.
改成 show 吧,跟其他组件 api 一致性高一些
export const props = { | ||
target: [String, Object] as PropType<string | HTMLElement>, | ||
title: String, | ||
description: String, |
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.
这个要不要改成 message?
TourSteps 这个组件可以考虑一下使用 useChildren useParent 之后,是否还是必要的。 |
Checklist
List of tasks you have already done and plan to do.
Change information
Describe your modifications here.
Issues
close #1797
Related Links
Links related to this pr.