Created
December 5, 2022 11:09
-
-
Save kuc-arc-f/8afb58b6197b71a13ba01b679b916f16 to your computer and use it in GitHub Desktop.
svelte, component sample
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
<script> | |
import {link} from 'svelte-spa-router' | |
export let parentFunc, testNum = 1; | |
//console.log(display); | |
// | |
const testFunc = function() { | |
console.log("testFunc"); | |
testNum = testNum + 1; | |
parentFunc(testNum); | |
} | |
</script> | |
<!-- Markup --> | |
<div class="paginate_wrap text-center "> | |
<button class="btn btn-lg btn-outline-dark " type="button" id="button-addon2" | |
on:click={testFunc}>Test | |
</button> | |
</div> |
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
<script lang="ts"> | |
/* svelte, component sample */ | |
import ChildBox from './test/ChildBox.svelte'; | |
// | |
const parentFunc = function(num: number) { | |
console.log("parentFunc", num); | |
} | |
</script> | |
<!-- MarkUp --> | |
<div class="container"> | |
<h2>test</h2> | |
<hr /> | |
<ChildBox parentFunc={parentFunc} /> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment