-
Notifications
You must be signed in to change notification settings - Fork 314
docs(pager): optimize pager demos #3612
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
Conversation
WalkthroughThe changes update multiple pager component demo and test files. Default page size values are increased, and available page size options are updated in several demo files. Many explicit Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant PagerDemo
participant TinyPager
User->>PagerDemo: Loads demo page
PagerDemo->>TinyPager: Renders with new defaults (page size 20, options [10,20,50,100])
User->>TinyPager: Interacts with pager (change size, navigate)
TinyPager-->>PagerDemo: Emits events (page change, size change)
PagerDemo-->>User: Updates display
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
examples/sites/demos/pc/app/pager/page-size-composition-api.vueOops! Something went wrong! :( ESLint: 8.57.1 ESLint couldn't find the plugin "eslint-plugin-vue". (The package "eslint-plugin-vue" was not found when loaded as a Node module from the directory "".) It's likely that the plugin isn't installed correctly. Try reinstalling by running the following:
The plugin "eslint-plugin-vue" was referenced from the config file in ".eslintrc.js » @antfu/eslint-config » @antfu/eslint-config-vue". If you still can't figure out the problem, please stop by https://eslint.org/chat/help to chat with the team. examples/sites/demos/pc/app/pager/page-size.vueOops! Something went wrong! :( ESLint: 8.57.1 ESLint couldn't find the plugin "eslint-plugin-vue". (The package "eslint-plugin-vue" was not found when loaded as a Node module from the directory "".) It's likely that the plugin isn't installed correctly. Try reinstalling by running the following:
The plugin "eslint-plugin-vue" was referenced from the config file in ".eslintrc.js » @antfu/eslint-config » @antfu/eslint-config-vue". If you still can't figure out the problem, please stop by https://eslint.org/chat/help to chat with the team. examples/sites/demos/pc/app/pager/page-size.spec.tsOops! Something went wrong! :( ESLint: 8.57.1 ESLint couldn't find the plugin "eslint-plugin-vue". (The package "eslint-plugin-vue" was not found when loaded as a Node module from the directory "".) It's likely that the plugin isn't installed correctly. Try reinstalling by running the following:
The plugin "eslint-plugin-vue" was referenced from the config file in ".eslintrc.js » @antfu/eslint-config » @antfu/eslint-config-vue". If you still can't figure out the problem, please stop by https://eslint.org/chat/help to chat with the team.
Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. ✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 0
🧹 Nitpick comments (1)
examples/sites/demos/pc/app/pager/popper-append-to-body.vue (1)
2-2
: Trim spaces inlayout
string to avoid stray tokens.The current value contains embedded spaces (
"sizes,prev, pager, next"
). If the component splits on commas without trimming, this may introduce an empty/whitespace token and break the layout parsing. Recommend removing the spaces:- <tiny-pager :popper-append-to-body="false" layout="sizes,prev, pager, next" :total="50"></tiny-pager> + <tiny-pager :popper-append-to-body="false" layout="sizes,prev,pager,next" :total="50"></tiny-pager>
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (2)
packages/theme/src/svgs/triangle-down.svg
is excluded by!**/*.svg
packages/theme/src/svgs/triangle-up.svg
is excluded by!**/*.svg
📒 Files selected for processing (9)
examples/sites/demos/pc/app/pager/page-size-composition-api.vue
(1 hunks)examples/sites/demos/pc/app/pager/page-size.spec.ts
(1 hunks)examples/sites/demos/pc/app/pager/page-size.vue
(1 hunks)examples/sites/demos/pc/app/pager/pager-in-grid-composition-api.vue
(0 hunks)examples/sites/demos/pc/app/pager/pager-in-grid.vue
(0 hunks)examples/sites/demos/pc/app/pager/popper-append-to-body-composition-api.vue
(1 hunks)examples/sites/demos/pc/app/pager/popper-append-to-body.vue
(1 hunks)examples/sites/demos/pc/app/pager/popper-class-composition-api.vue
(1 hunks)examples/sites/demos/pc/app/pager/popper-class.vue
(1 hunks)
💤 Files with no reviewable changes (2)
- examples/sites/demos/pc/app/pager/pager-in-grid.vue
- examples/sites/demos/pc/app/pager/pager-in-grid-composition-api.vue
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: PR E2E Test (pnpm test:e2e3)
🔇 Additional comments (7)
examples/sites/demos/pc/app/pager/popper-class-composition-api.vue (1)
2-2
: LGTM! Demo simplification improves focus.Removing the explicit
page-size
andpage-sizes
props allows the component to use default values, making this demo cleaner and more focused on demonstrating thepopper-class
functionality.examples/sites/demos/pc/app/pager/popper-append-to-body-composition-api.vue (1)
2-2
: LGTM! Demo simplification enhances clarity.The removal of explicit
page-size
andpage-sizes
props streamlines this demo to focus on thepopper-append-to-body
functionality while using component defaults for pagination settings.examples/sites/demos/pc/app/pager/popper-class.vue (1)
2-2
: Consistent simplification with composition API variant.This change aligns well with the composition API version of this demo, maintaining consistency across different API styles while focusing on the core
popper-class
functionality.examples/sites/demos/pc/app/pager/page-size.vue (2)
2-2
: Improved default page size values for better demo experience.The update from page size 5 to 20 and the revised page size options
[10, 20, 50, 100]
provide more realistic and practical values for demonstrating pagination functionality.
6-6
: Good cleanup of unused import.Removing the unused
TinyModal
import improves code cleanliness.examples/sites/demos/pc/app/pager/page-size.spec.ts (1)
10-10
: Test updated to match demo changes.The update from
initPageSize = 5
toinitPageSize = 20
correctly aligns the test expectations with the updated default page size in the corresponding demo file.examples/sites/demos/pc/app/pager/page-size-composition-api.vue (1)
2-2
: Demo correctly reflects new defaults – looks good.The updated
page-size
andpage-sizes
align with the global pager demo changes and remove an unused import. No functional issues spotted.
PR
分页组件demo优化
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Issue Number: N/A
What is the new behavior?
Does this PR introduce a breaking change?
Other information
Summary by CodeRabbit