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

[cdk:breakpoint] add breakpoint system and observeBreakpoint #44

Closed
1 task done
danranVm opened this issue Dec 20, 2020 · 3 comments · Fixed by #58
Closed
1 task done

[cdk:breakpoint] add breakpoint system and observeBreakpoint #44

danranVm opened this issue Dec 20, 2020 · 3 comments · Fixed by #58
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@danranVm
Copy link
Member

danranVm commented Dec 20, 2020

  • I have searched the issues of this repository and believe that this is not a duplicate.

What problem does this feature solve?

  • 栅格断点系统
  • 支持响应式

What does the proposed API look like?

export enum Breakpoints = {
  XSmall: '(max-width: 599.99px)',
  Small: '(min-width: 768px) and (max-width: 1023.99px)',
  Medium: '(min-width: 1024px) and (max-width: 1279.99px)',
  Large: '(min-width: 1280px) and (max-width: 1719.99px)',
  XLarge: '(min-width: 1720px)',
}
// 非响应式
const isXSmall  = isMatchedBreakpoint(Breakpoints.XSmall)
// 响应式
const layoutChange = observeBreakpoint(Breakpoints.XSmall)
// const layoutChange = observeBreakpoint([Breakpoints.XSmall, Breakpoints.Large])
watchEffect(() => {
 console.log('breakpoints', layoutChanges.value.breakpoints)
  console.log('matches', layoutChanges.value.matches)
})
// 清空观察者
cleanObservables()
@danranVm danranVm added the enhancement New feature or request label Dec 20, 2020
@danranVm
Copy link
Member Author

@coolyuantao @zymoplastic 请 review 一下。

@danranVm danranVm mentioned this issue Dec 20, 2020
95 tasks
@zymoplastic
Copy link
Contributor

断点的值可能需要再找人讨论一下

@danranVm
Copy link
Member Author

默认断点值已经调整

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants