mirror of https://github.com/sveltejs/svelte
add missing export for hasContext (#5727)
parent
505eba84b9
commit
ccc61a71d8
@ -0,0 +1,7 @@
|
|||||||
|
<script>
|
||||||
|
import { hasContext } from 'svelte';
|
||||||
|
|
||||||
|
const has = hasContext('test');
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<div>{has}</div>
|
@ -0,0 +1,11 @@
|
|||||||
|
<script>
|
||||||
|
import { setContext } from 'svelte';
|
||||||
|
|
||||||
|
export let value = '';
|
||||||
|
|
||||||
|
if (value) {
|
||||||
|
setContext('test', value);
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<slot></slot>
|
@ -0,0 +1,6 @@
|
|||||||
|
export default {
|
||||||
|
html: `
|
||||||
|
<div>true</div>
|
||||||
|
<div>false</div>
|
||||||
|
`
|
||||||
|
};
|
@ -0,0 +1,12 @@
|
|||||||
|
<script>
|
||||||
|
import Nested from "./Nested.svelte";
|
||||||
|
import Leaf from "./Leaf.svelte";
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<Nested value="bar">
|
||||||
|
<Leaf />
|
||||||
|
</Nested>
|
||||||
|
|
||||||
|
<Nested>
|
||||||
|
<Leaf />
|
||||||
|
</Nested>
|
Loading…
Reference in new issue