docs/content/docs/2.components/alert.md:81-83 passes the avatar as flat dotted
keys in the ::component-code frontmatter:
props:
avatar.src: '/b24ui/avatar/employee.png'
avatar.size: ...
avatar.loading: ...
docs/app/components/content/ComponentCode.vue builds componentProps straight
from the literal entries:
const componentProps = reactive({
...Object.fromEntries(Object.entries(props.props || {}).map(([key, value]) => {
// ...
return [key, cast ? castMap[cast]!.get(value) : value]
}))
})
Nothing expands a dotted key into a nested object, so the component receives a
prop literally named avatar.src and never an avatar object. The avatar
branch is gated on props.avatar, so the example renders no avatar at all,
and avatar.src="…" leaks onto the root element as an attribute. The generated
snippet the reader copies is not valid Vue either.
The correct form, used elsewhere in the same docs tree, is nested:
props:
avatar:
src: '/b24ui/avatar/employee.png'
Note the ignore: / hide: lists are a different thing — they take dotted
paths on purpose (mapKeys in the same file builds them), so - avatar.src
under ignore: is correct and must stay as it is. Only keys under props: are
affected.
Scope
grep -rn "^\s*avatar\.[a-zA-Z]*:" docs/content/ finds this in alert.md only —
the other occurrences were in user.md and were fixed alongside the User
color work. Worth re-running the grep at fix time rather than trusting this
line, and worth widening it: any prop whose value is an object can have been
written the same way, not just avatar.
Not verified
The claim that the example renders no avatar comes from reading
ComponentCode.vue and the component's v-if, not from opening the docs site.
Confirm in the browser before and after.
docs/content/docs/2.components/alert.md:81-83passes the avatar as flat dottedkeys in the
::component-codefrontmatter:docs/app/components/content/ComponentCode.vuebuildscomponentPropsstraightfrom the literal entries:
Nothing expands a dotted key into a nested object, so the component receives a
prop literally named
avatar.srcand never anavatarobject. The avatarbranch is gated on
props.avatar, so the example renders no avatar at all,and
avatar.src="…"leaks onto the root element as an attribute. The generatedsnippet the reader copies is not valid Vue either.
The correct form, used elsewhere in the same docs tree, is nested:
Note the
ignore:/hide:lists are a different thing — they take dottedpaths on purpose (
mapKeysin the same file builds them), so- avatar.srcunder
ignore:is correct and must stay as it is. Only keys underprops:areaffected.
Scope
grep -rn "^\s*avatar\.[a-zA-Z]*:" docs/content/finds this inalert.mdonly —the other occurrences were in
user.mdand were fixed alongside theUsercolorwork. Worth re-running the grep at fix time rather than trusting thisline, and worth widening it: any prop whose value is an object can have been
written the same way, not just
avatar.Not verified
The claim that the example renders no avatar comes from reading
ComponentCode.vueand the component'sv-if, not from opening the docs site.Confirm in the browser before and after.