다음을 통해 공유


BL0003: CaptureUnmatchedValues가 있는 구성 요소 매개 변수의 형식이 잘못되었습니다.

가치
규칙 아이디 BL0003
범주 사용법
수정 사항이 문제를 해결하고 있는지 혹은 새로운 문제를 일으키지 않는지 여부 속보

원인

ComponentBase CaptureUnmatchedValues로 주석이 추가된 = true에서 파생된 형식의 매개 변수는 Dictionary<string, object>에 할당할 수 없습니다.

규칙 설명

주석 달린 CaptureUnmatchedValues = true 매개변수는 Dictionary<string, object> 값을 받을 수 있도록 해야 합니다.

@code
{
    [Parameter(CaptureUnmatchedValues = true)] public IDictionary<string, string> Attributes { get; set; }
}

위반을 해결하는 방법

매개 변수의 형식을 IDictionary<string, object> 또는 Dictionary<string, object>로 변경하세요.

@code
{
    [Parameter(CaptureUnmatchedValues = true)] public IDictionary<string, object> Attributes { get; set; }
}

경고를 표시하지 않는 경우

이 규칙의 경고를 숨기지 마세요.