버튼 클릭 시 Blazor에서 클래스를 전환하는 방법은 무엇입니까?
P粉041881924
P粉041881924 2024-03-28 00:07:37
0
1
383

현재 다음과 같이 클래스를 전환하는 onclick 이벤트가 있습니다.

....
<button id="@m.TargetCo.ButtonId" onclick="glyphChanger(this.id)" class="btn btn-default iconButton glyphicon glyphicon-chevron-right" ></button>
....
function glyphChanger(buttonID) {
    $("#" + buttonID).toggleClass('glyphicon-chevron-right glyphicon-chevron-up');
}

P粉041881924
P粉041881924

모든 응답(1)
P粉269847997

자바스크립트가 필요하지 않습니다. Blazor 방식으로 이 작업을 수행할 수 있습니다.

DropDownComponent.razor

으아악

앱의 다른 위치

으아악
최신 다운로드
더>
웹 효과
웹사이트 소스 코드
웹사이트 자료
프론트엔드 템플릿
회사 소개 부인 성명 Sitemap
PHP 중국어 웹사이트:공공복지 온라인 PHP 교육,PHP 학습자의 빠른 성장을 도와주세요!