-
-
Save chancyk/718e162960a02dbeb69c9e9453e8a0e7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const ComponentButton = (props, { $onMounted }) => { | |
$onMounted(() => { | |
console.log("[TEST] COMPONENT BUTTON MOUNTED"); | |
}); | |
return () => ( | |
<button | |
class="button button-fill button-preloader button-loading" | |
onclick={() => props.fnClicked()}> | |
<span class="preloader"></span> | |
<span>{props.label}</span> | |
</button> | |
) | |
} | |
const ComponentParent = (props, { $onMounted }) => { | |
$onMounted(() => { | |
console.log("[TEST] COMPONENT PARENT MOUNTED"); | |
}); | |
return () => ( | |
<ComponentButton | |
label='Click Me' | |
fn-clicked={props.fnButtonClicked}> | |
</ComponentButton> | |
); | |
} | |
export default (props, { $on, $onMounted }) => { | |
$onMounted(() => { | |
console.log("[TEST] MOUNTED"); | |
}); | |
$on('page:init', () => { | |
console.log("[TEST] PAGE INIT"); | |
}); | |
function doNothing() { | |
console.log("[TEST] Clicked!"); | |
} | |
return () => ( | |
<div class="page"> | |
<div class="page-content"> | |
<ComponentParent fn-button-clicked={doNothing}></ComponentParent> | |
</div> | |
</div> | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment