Skip to content
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

feat: Menu component #333

Merged
merged 51 commits into from
Nov 1, 2023
Merged

feat: Menu component #333

merged 51 commits into from
Nov 1, 2023

Conversation

lycHub
Copy link
Contributor

@lycHub lycHub commented Sep 29, 2023

新增 menu component

@foolmadao
Copy link

第二个demo展开收起,标题和内容注明是横向的展开收缩,明确一些。
最后一个demo自动展开选中菜单,感觉场景不是很常用,只是为了初始化展开的化直接数据控制就好了,建议删除。

@lycHub
Copy link
Contributor Author

lycHub commented Oct 10, 2023

第二个demo展开收起,标题和内容注明是横向的展开收缩,明确一些。 最后一个demo自动展开选中菜单,感觉场景不是很常用,只是为了初始化展开的化直接数据控制就好了,建议删除。

已改

@lycHub
Copy link
Contributor Author

lycHub commented Oct 10, 2023

u感觉没啥必要

我说的是横向的collapse

collapsed是用户自己控制 [collapsed]的 不用再暴露事件

@lycHub
Copy link
Contributor Author

lycHub commented Oct 10, 2023

我研究了下,用ngTemplateOutlet递归有下面三个问题,
image

所以目前的api设计只能自行封装递归组件,其实也挺简单的,copy下demo代码就行 😅

devui/menu/menu.component.scss Outdated Show resolved Hide resolved
devui/button/button.component.html Outdated Show resolved Hide resolved
devui/menu/sub-menu.component.html Outdated Show resolved Hide resolved
@Simplelegant
Copy link
Collaborator

Simplelegant commented Oct 13, 2023

还有些细节问题再处理下就差不多了

  1. 递归菜单中有横向滚动条
    image
  2. 由于首项和尾项有4px margin 菜单上下的留白变为了24px,看下是取消首尾4px margin 还是减小菜单的padding,预期是上下留白20px
    image
  3. 好多文件中有注释代码,请删除
  4. demo细节有空的话你也可以再过一下看还有没有没发现的遗漏问题

@lycHub
Copy link
Contributor Author

lycHub commented Oct 13, 2023

还有些细节问题再处理下就差不多了

  1. 递归菜单中有横向滚动条
    image
  2. 由于首项和尾项有4px margin 菜单上下的留白变为了24px,看下是取消首尾4px margin 还是减小菜单的padding,预期是上下留白20px
    image
  3. 好多文件中有注释代码,请删除
  4. demo细节有空的话你也可以再过一下看还有没有没发现的遗漏问题

已改,滚动条暂时视觉隐藏了,一时没找到啥好方法,我再看看

@lycHub
Copy link
Contributor Author

lycHub commented Oct 14, 2023

都改完 菜单宽度还是让用户设置,避免滚动条

@@ -0,0 +1,32 @@
<div class="demo-menu" style="width: 388px; overflow-x: auto">
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

menu的宽度现在是怎么设置呢,是调整此处外围容器的宽度还是调整--devui-menu-width
刚试了下调小外层容器宽度会有水平滚动条,而且内容和箭头会重叠
image

Copy link
Contributor Author

@lycHub lycHub Oct 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我试了各种title长度和层级深度,没找到一种比较兼容的样式😭
所以全放开了,外围容器宽度,title换行还是省略号啥的 就让用户根据具体菜单自行调整吧😂

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我试了各种title长度和层级深度,没找到一种比较兼容的样式😭 所以全放开了,外围容器宽度,title换行还是省略号啥的 就让用户根据具体菜单自行调整吧😂

这样感觉用户使用成本很高,菜单文本不同宽度就要去适配外层容器宽度和省略方案

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

给title加了省略号

Simplelegant
Simplelegant previously approved these changes Oct 20, 2023
src/app/app.component.scss Outdated Show resolved Hide resolved
@@ -84,7 +84,7 @@ export class DevuiOnlineIdeService {
}

getFiles(sourceData: DevuiSourceData[], ide: 'StackBlitz' | 'CodeSandbox' = 'StackBlitz'): any {
console.log(sourceData);
// console.log(sourceData);
Copy link
Collaborator

@Simplelegant Simplelegant Oct 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. 还有对其它地方代码的修改,请恢复
  2. 还有很多console.log()没有删除,请全面排查

devui/package.json Outdated Show resolved Hide resolved
@wangyaju wangyaju merged commit d26efe4 into DevCloudFE:master Nov 1, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants