fix DOMLoaded in code examples (#1204)

This commit is contained in:
x4dr 2024-06-13 18:38:48 +02:00 committed by GitHub
parent 0472daa003
commit 19e127f6ad
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -129,11 +129,11 @@ export default (() => {
return <button id="btn">Click me</button>
}
YourComponent.beforeDOM = `
YourComponent.beforeDOMLoaded = `
console.log("hello from before the page loads!")
`
YourComponent.afterDOM = `
YourComponent.afterDOMLoaded = `
document.getElementById('btn').onclick = () => {
alert('button clicked!')
}
@ -180,7 +180,7 @@ export default (() => {
return <button id="btn">Click me</button>
}
YourComponent.afterDOM = script
YourComponent.afterDOMLoaded = script
return YourComponent
}) satisfies QuartzComponentConstructor
```