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

fix(select): [select] modifying the loading icon issue #2242

Merged
merged 2 commits into from
Oct 14, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/vue/src/select/src/pc.vue
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,7 @@

<component
class="circular"
:is="state.designConfig.icons.loadingIcon || 'icon-loading-shadow'"
:is="state.designConfig?.icons?.loadingIcon || 'icon-loading-shadow'"
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Avoid Using Optional Chaining (?.) in Vue 2 Templates

Optional chaining (?.) is not natively supported in Vue 2 templates and can cause compilation issues during the build process. To ensure compatibility and prevent potential errors, consider refactoring the expression to avoid using optional chaining in the template.

Apply this diff to replace the optional chaining:

- :is="state.designConfig?.icons?.loadingIcon || 'icon-loading-shadow'"
+ :is="(state.designConfig && state.designConfig.icons && state.designConfig.icons.loadingIcon) || 'icon-loading-shadow'"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
:is="state.designConfig?.icons?.loadingIcon || 'icon-loading-shadow'"
:is="(state.designConfig && state.designConfig.icons && state.designConfig.icons.loadingIcon) || 'icon-loading-shadow'"

Copy link
Member

Choose a reason for hiding this comment

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

这种?.的操作符貌似在vue2的版本中无法识别,建议改成机器人提供的写法:state.designConfig && state.designConfig.icons && state.designConfig.icons.loadingIcon

></component>
</div>
</template>
Expand Down
Loading