-
Notifications
You must be signed in to change notification settings - Fork 2.8k
fix: knowledge icon error #2744
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -67,14 +67,14 @@ | |
| <img src="@/assets/icon_web.svg" style="width: 58%" alt="" /> | ||
| </AppAvatar> | ||
| <AppAvatar | ||
| v-if="!item.dataset_id && item.type === '2'" | ||
| class="mr-8 avatar-purple" | ||
| shape="square" | ||
| :size="24" | ||
| style="background: none" | ||
| > | ||
| <img src="@/assets/logo_lark.svg" style="width: 100%" alt="" /> | ||
| </AppAvatar> | ||
| v-else-if="!item.dataset_id && item.type === '2'" | ||
| class="mr-8 avatar-purple" | ||
| shape="square" | ||
| :size="24" | ||
| style="background: none" | ||
| > | ||
| <img src="@/assets/logo_lark.svg" style="width: 100%" alt="" /> | ||
| </AppAvatar> | ||
| <AppAvatar | ||
| v-else-if="!item.dataset_id && item.type === '0'" | ||
| class="mr-12 avatar-blue" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There appears to be an indentation issue after <AppAvatar
v-else-if="!item.dataset_id && item.type === '2'"
class="mr-8 avatar-purple"
:size="24"
style="background: none"
>
<img src="@/assets/logo_lark.svg" style="width: 100%" alt="" />
</AppAvatar>
<AppAvatar
v-else-if="!item.dataset_id && item.type === '0'"
class="mr-12 avatar-blue"
:size="24"
style="background: none"
>
<img src="@/assets/icon_user_profile.svg" style="width: 100%" alt="" />
</AppAvatar>Make sure there are spaces between each attribute and close every tag properly for syntax correctness. Also ensure that the |
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -232,7 +232,7 @@ | |
| <img src="@/assets/icon_web.svg" style="width: 58%" alt="" /> | ||
| </AppAvatar> | ||
| <AppAvatar | ||
| v-if="!item.dataset_id && item.type === '2'" | ||
| v-else-if="!item.dataset_id && item.type === '2'" | ||
| class="mr-12 avatar-purple" | ||
| shape="square" | ||
| :size="24" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here's a review of the code change: Improvement suggestion 1: Simplify the v-else-if="(item.dataset_id && item.type !== "2") || (!item.dataset_id && item.type !=="0")This way, you only need to check whether General improvement suggestion: Overall note: |
||
|
|
||
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.
The code you provided has the following changes:
The
altattribute of the first<img>tag is set to "", which means it lacks an alternative text description if it fails to load, making it unusable for accessibility.The
v-ifcondition checks if the related object's type is "2", but there seems to be a logical error because the value being checked ('type') does not exist in most objects returned byrelatedObject. It should either check another property likedata.typeor ensure that all relevant data points are included.For optimization, removing the
style="width: 58%"can make rendering faster since CSS properties directly on elements are less efficient than inline styles using Vue.js directives (e.g.,@).A best practice would be to replace
item, which likely refers to a dataset, with a more descriptive name such asdatasetItem.Here is the revised version of the code snippet:
This change makes several improvements while maintaining functionality:
itemtodatasetItem.relatedObject.