Repository navigation
fix: style #7777
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: style #7777
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 |
|---|---|---|
|
|
@@ -2,6 +2,7 @@ | |
| import { computed } from 'vue' | ||
| import type { CSSProperties } from 'vue' | ||
| import type { ApplicationDisplaySetting } from '@/api/types' | ||
| import defaultFloatIconUrl from '/MaxKB.gif?url' | ||
|
|
||
| defineOptions({ name: 'DisplaySettingPreview' }) | ||
|
|
||
|
|
@@ -79,6 +80,6 @@ const previewHeaderStyle = computed<CSSProperties>(() => ({ | |
| </div> | ||
| </div> | ||
| <!-- 浮窗图标 --> | ||
| <img :src="previewImages.float_icon || './MaxKB.gif'" alt="" class="size-8 shrink-0 object-contain" /> | ||
| <img :src="previewImages.float_icon || defaultFloatIconUrl" alt="" class="size-8 shrink-0 object-contain" /> | ||
| </div> | ||
| </template> | ||
|
Contributor
Author
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 my review of the diff: Issues / potential concerns:
Optimization suggestions:
Overall the change is functionally sound, but the absolute import path is the main thing I'd fix before merging. |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -27,7 +27,7 @@ const showContent = computed(() => isSuccess.value || props.showContentOnError) | |
| <slot name="header" /> | ||
| </template> | ||
| <!-- 内容区独立交互,避免链接、表单和嵌套详情点击时收起外层卡片。 --> | ||
| <div v-if="show" class="mt-4 cursor-auto space-y-2" @click.stop> | ||
| <div v-if="show" class="mt-4 cursor-auto space-y-2 wrap-anywhere" @click.stop> | ||
| <slot v-if="showContent" /> | ||
| <div v-else class="mk-gray-card-sm"> | ||
| <h6 class="mb-2">错误日志</h6> | ||
|
Contributor
Author
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 diff: Change summary
Potential issues
Suggestions
No correctness bugs introduced by the change itself, assuming the utility exists. The main risk is a silent no-op if |
||
|
|
||
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.
Here are my observations on this diff:
1.
popper-optionsis a deprecated prop in Element PlusDepending on your Element Plus version,
:popper-optionsmay have been replaced by:popper-class/:teleported/ the newerpopoverconfig API. In Element Plus ≥ 2.0, the dropdown/select components usepopperOptionsas a plain object passed via$attrs, but the actual accepted shape is{ modifiers, strategy, ... }. Verify against your installed version's docs — otherwise the option will be silently ignored.Also make sure not to name it in snake_case with a hyphen mixed into a top-level attribute if your component isn't configured to inherit attrs (see next point).
2. Interaction with
v-bind="$attrs"Because
$attrsis spread after:popper-options, any user-providedpopperOptionswill overridepopperOptionsfrom the component unlessinheritAttrs: falseand explicit merging is done. Consider usingv-bind="mergeAttrs({ popperOptions })"or apply$attrsfirst so your default can act as a fallback:3. Where is
popperOptionsdefined?The diff only shows the template binding — ensure
popperOptionsis declared in<script setup>(likely as adefinePropsfield or local ref). If it's aref, the binding should be:popper-options="popperOptions"(works for refs in templates) but if it's expected to be reactive on mutations you need to reassign the ref, not mutate.valuedeeply.4. Type safety
If the codebase uses TypeScript, type the prop explicitly:
Otherwise
anypropagated from the parent leaks in silently.5. Potential perf nit
popperOptionsobjects passed inline (e.g.:popper-options="{ placement: 'bottom' }") create a new reference each render, causing the dropdown to re-initialize its Popper instance. Prefer a stable object fromcomputedorreadonly.6. Naming convention consistency
Your file uses
kebab-case(hide-when-empty,visible-change) for other props;:popper-optionsmatches that, good. Just double-check the component's declared prop name ispopperOptions(notpopper-options) so binding resolution works correctly in both setups.7. Missing guards
Add a guard so an undefined
popperOptionsdoesn't get passed through to Element Plus (which expects an object):Summary: the change itself is fine syntactically, but verify prop deprecation status,
$attrsprecedence, and reactivity of the options object to avoid subtle overrides or re-init churn.