Skip to content

pantoken-root / formats/scope/src / resolveScope

Συνάρτηση: resolveScope() ​

resolveScope(start): ResolvedScope

Βήτα

Επίλυση του scope που ισχύει για start ανιχνεύοντας προς τους προγόνους του.

Παράμετροι ​

start ​

Element | null

Το στοιχείο για το οποίο γίνεται η επίλυση. Τα δικά του attributes συμμετέχουν.

Επιστρέφει ​

ResolvedScope

Το ResolvedScope; πεδία που κανένας πρόγονος δεν δήλωσε παραμένουν undefined.

Παράδειγμα ​

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

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