fix(Skeleton): fix non-props attributes warning (#10384)

This commit is contained in:
neverland 2022-03-13 15:51:10 +08:00 committed by GitHub
parent 09694feaad
commit 3bb729214e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -38,9 +38,11 @@ export type SkeletonProps = ExtractPropTypes<typeof skeletonProps>;
export default defineComponent({ export default defineComponent({
name, name,
inheritAttrs: false,
props: skeletonProps, props: skeletonProps,
setup(props, { slots }) { setup(props, { slots, attrs }) {
const renderAvatar = () => { const renderAvatar = () => {
if (props.avatar) { if (props.avatar) {
return ( return (
@ -90,7 +92,10 @@ export default defineComponent({
} }
return ( return (
<div class={bem({ animate: props.animate, round: props.round })}> <div
class={bem({ animate: props.animate, round: props.round })}
{...attrs}
>
{renderAvatar()} {renderAvatar()}
<div class={bem('content')}> <div class={bem('content')}>
{renderTitle()} {renderTitle()}