mirror of
				https://github.com/alrayyes/wiki.git
				synced 2025-08-07 15:21:03 +00:00 
			
		
		
		
	fix DOMLoaded in code examples (#1204)
This commit is contained in:
		
					parent
					
						
							
								0472daa003
							
						
					
				
			
			
				commit
				
					
						19e127f6ad
					
				
			
		
					 1 changed files with 3 additions and 3 deletions
				
			
		| 
						 | 
				
			
			@ -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
 | 
			
		||||
```
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue