다음을 통해 공유


BL0002: 구성 요소에 여러 CaptureUnmatchedValues 매개 변수가 있습니다.

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

원인

ComponentBase에서 파생된 형식의 매개 변수 중 두 개 이상이 CaptureUnmatchedValues = true으로 주석 처리되어 있습니다.

규칙 설명

구성 요소에는 CaptureUnmatchedValues이(가) true로 설정된 매개 변수가 정확히 하나 있어야 합니다.

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

    [Parameter(CaptureUnmatchedValues = true)] public Dictionary<string, object> Parameter2 { get; set; }
}

위반을 해결하는 방법

단일 매개 변수를 설정하도록 제한합니다 CaptureUnmatchedValues .

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

    [Parameter] public Dictionary<string, object> Parameter2 { get; set; }
}

경고를 표시하지 않는 경우

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