Skip to content

pantoken-root / formats/scope/src / resolveScope

ฟังก์ชัน: resolveScope() ​

resolveScope(start): ResolvedScope

เบต้า

แก้ไขสโคปที่มีผลสำหรับ 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"