Skip to content

pantoken-root / formats/scope/src / resolveScope

함수: resolveScope() ​

resolveScope(start): ResolvedScope

베타

Resolve the scope in effect for start 를 조상들을 따라 올라가며 결정합니다.

매개변수 ​

start ​

Element | null

해결 대상 요소입니다. 해당 요소의 속성들도 참여합니다.

반환값 ​

ResolvedScope

The ResolvedScope; 조상에서 선언하지 않은 필드는 undefined로 남습니다.

예제 ​

ts
import { resolveScope } from "@pantoken/scope";

// <div data-pantoken-theme="canvas"><span id="x"></span></div>
resolveScope(document.querySelector("#x")!).theme; // "canvas"