-
Notifications
You must be signed in to change notification settings - Fork 7.1k
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: v-loading support for element plus
#5008
Conversation
|
WalkthroughThe pull request introduces changes to two main files: Changes
Possibly related PRs
Suggested reviewers
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
apps/web-ele/src/bootstrap.tsOops! Something went wrong! :( ESLint: 9.16.0 Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/node_modules/@vben/eslint-config/dist/index.mjs' imported from /eslint.config.mjs Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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
🧹 Outside diff range and nitpick comments (2)
apps/web-ele/src/bootstrap.ts (1)
23-24
: Consider translating the Chinese comment for better accessibility.The directive registration is implemented correctly, but consider translating the comment "注册Element Plus提供的v-loading指令" to English for better international collaboration.
- // 注册Element Plus提供的v-loading指令 + // Register v-loading directive provided by Element Plusapps/web-ele/src/views/demos/element/index.vue (1)
103-108
: Enhance the loading demo with interactive controls.The current implementation has the loading state hardcoded to
true
. Consider adding:
- A toggle button to demonstrate dynamic loading states
- Error state handling
- Loading text customization example
Here's a suggested implementation:
- <div class="flex size-72 items-center justify-center" v-loading="true"> + <div class="flex size-72 items-center justify-center" v-loading="isLoading" element-loading-text="Loading..."> 一些演示的内容 </div> + <div class="mt-4"> + <ElButton @click="isLoading = !isLoading"> + {{ isLoading ? 'Stop Loading' : 'Start Loading' }} + </ElButton> + </div>Add to the script section:
const isLoading = ref(false);
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (2)
apps/web-ele/src/bootstrap.ts
(2 hunks)apps/web-ele/src/views/demos/element/index.vue
(1 hunks)
🔇 Additional comments (2)
apps/web-ele/src/bootstrap.ts (1)
10-10
: LGTM! Efficient import strategy.
The named import of ElLoading
is well-structured and supports tree-shaking, aligning with the goal of minimal imports.
apps/web-ele/src/views/demos/element/index.vue (1)
64-102
: LGTM! Well-structured responsive layout.
The flex layout implementation with consistent utility classes provides good responsiveness and maintainability.
Description
将element-plus提供的v-loading指令注册为可用。
对element-plus不太熟悉的同学可能在没有完整引入的情况下难以使用这个指令,此PR将此常用指令手动注册以达到开箱即用的结果。
Type of change
Please delete options that are not relevant.
pnpm-lock.yaml
unless you introduce a new test example.Checklist
pnpm run docs:dev
command.pnpm test
.feat:
,fix:
,perf:
,docs:
, orchore:
.Summary by CodeRabbit
New Features
v-loading
) for enhanced user feedback during loading processes.Improvements
Bug Fixes