-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
135 additions
and
3 deletions.
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
/* generated by Svelte vX.Y.Z */ | ||
import { | ||
SvelteComponent, | ||
append, | ||
attr, | ||
detach, | ||
element, | ||
init, | ||
insert, | ||
listen, | ||
noop, | ||
run_all, | ||
safe_not_equal, | ||
set_input_value, | ||
space | ||
} from "svelte/internal"; | ||
|
||
function create_fragment(ctx) { | ||
var form, input, t, button, dispose; | ||
|
||
return { | ||
c() { | ||
form = element("form"); | ||
input = element("input"); | ||
t = space(); | ||
button = element("button"); | ||
button.textContent = "Store"; | ||
attr(input, "type", "text"); | ||
input.required = true; | ||
|
||
dispose = [ | ||
listen(input, "input", ctx.input_input_handler), | ||
listen(form, "submit", ctx.handleSubmit) | ||
]; | ||
}, | ||
|
||
m(target, anchor) { | ||
insert(target, form, anchor); | ||
append(form, input); | ||
|
||
set_input_value(input, ctx.test); | ||
|
||
append(form, t); | ||
append(form, button); | ||
}, | ||
|
||
p(changed, ctx) { | ||
if (changed.test && (input.value !== ctx.test)) set_input_value(input, ctx.test); | ||
}, | ||
|
||
i: noop, | ||
o: noop, | ||
|
||
d(detaching) { | ||
if (detaching) { | ||
detach(form); | ||
} | ||
|
||
run_all(dispose); | ||
} | ||
}; | ||
} | ||
|
||
function instance($$self, $$props, $$invalidate) { | ||
let test = undefined; | ||
|
||
function handleSubmit(event) { | ||
event.preventDefault(); | ||
console.log('value', test); | ||
} | ||
|
||
function input_input_handler() { | ||
test = this.value; | ||
$$invalidate('test', test); | ||
} | ||
|
||
return { test, handleSubmit, input_input_handler }; | ||
} | ||
|
||
class Component extends SvelteComponent { | ||
constructor(options) { | ||
super(); | ||
init(this, options, instance, create_fragment, safe_not_equal, []); | ||
} | ||
} | ||
|
||
export default Component; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<script> | ||
let test = undefined; | ||
function handleSubmit(event) { | ||
event.preventDefault(); | ||
console.log('value', test); | ||
} | ||
</script> | ||
|
||
<form on:submit={handleSubmit}> | ||
<input bind:value={test} type=text required> | ||
<button>Store</button> | ||
</form> |
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
5 changes: 5 additions & 0 deletions
5
test/runtime/samples/component-slot-let-missing-prop/Bar.svelte
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<script> | ||
export let thing; | ||
</script> | ||
|
||
<p>{thing}</p> |
1 change: 1 addition & 0 deletions
1
test/runtime/samples/component-slot-let-missing-prop/Foo.svelte
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<slot></slot> |
5 changes: 5 additions & 0 deletions
5
test/runtime/samples/component-slot-let-missing-prop/_config.js
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export default { | ||
html: ` | ||
<p>undefined</p> | ||
` | ||
}; |
10 changes: 10 additions & 0 deletions
10
test/runtime/samples/component-slot-let-missing-prop/main.svelte
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<script> | ||
import Foo from './Foo.svelte'; | ||
import Bar from './Bar.svelte'; | ||
const things = { '1': 'one' }; | ||
</script> | ||
|
||
<Foo let:id> | ||
<Bar thing={things[id]}/> | ||
</Foo> |