mirror of https://github.com/sveltejs/svelte
Merge 6d5508df23 into c2b7642263
commit
dd5bd34c12
@ -0,0 +1,5 @@
|
||||
---
|
||||
'svelte': minor
|
||||
---
|
||||
|
||||
feat: add has function to createContext
|
||||
@ -1,7 +1,10 @@
|
||||
<script>
|
||||
import { get } from './main.svelte';
|
||||
import { get, has } from './main.svelte';
|
||||
|
||||
const message = get();
|
||||
</script>
|
||||
|
||||
<h1>{message}</h1>
|
||||
{#if has()}
|
||||
<h2>it's me</h2>
|
||||
{/if}
|
||||
|
||||
@ -1,7 +1,10 @@
|
||||
<script>
|
||||
import { get } from './main.svelte';
|
||||
import { get, has } from './main.svelte';
|
||||
|
||||
const message = get();
|
||||
</script>
|
||||
|
||||
<h1>{message}</h1>
|
||||
{#if has()}
|
||||
<h2>it's me</h2>
|
||||
{/if}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { test } from '../../test';
|
||||
|
||||
export default test({
|
||||
html: `<h1>hello</h1>`
|
||||
html: `<h1>hello</h1><h2>it's me</h2>`
|
||||
});
|
||||
|
||||
Loading…
Reference in new issue