0
미주를 표시하기 위해 내 사이트 전체에 공통 모달이 있습니다. 나는 구조를 반복해서 타이핑 할 필요가 없도록 빠른 pug mixin을 만들고 싶었다.JavaScript에 pug mixin 전달
그러나 jid toggle_visibility 함수에 #id를 전달하는 방법을 모르겠습니다. 당신이있어 무엇 (믹스 인 외부) 여기
mixin modal(id, content)
div.modal(class= id)
div.modal-content= content
a.close(onclick="toggle_visibility('= id');") Close
이 작업 퍼그 코드의 예
div.modal#downloads-citations
div.modal-content
p some content here to show article citations
a.close(onclick="toggle_visibility('downloads-citations');") Close
완벽하게 작동합니다. 고맙습니다!!!! –
도와 주시겠습니까? 스택 오버플로에 오신 것을 환영합니다! 이 답변으로 문제가 해결되면 승인 된 것으로 표시하십시오. – gandreadis