Skip to content

Instantly share code, notes, and snippets.

@kuc-arc-f
Created December 5, 2022 11:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kuc-arc-f/8afb58b6197b71a13ba01b679b916f16 to your computer and use it in GitHub Desktop.
Save kuc-arc-f/8afb58b6197b71a13ba01b679b916f16 to your computer and use it in GitHub Desktop.
svelte, component sample
<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>
<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