-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
remove components without props from each block - fixes #3035
- Loading branch information
1 parent
35001b3
commit 7696c1f
Showing
4 changed files
with
25 additions
and
1 deletion.
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
1 change: 1 addition & 0 deletions
1
test/runtime/samples/each-block-component-no-props/Child.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 @@ | ||
<p>hello</p> |
10 changes: 10 additions & 0 deletions
10
test/runtime/samples/each-block-component-no-props/_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,10 @@ | ||
export default { | ||
html: ` | ||
<p>hello</p> | ||
`, | ||
|
||
async test({ assert, component, target }) { | ||
await component.remove(); | ||
assert.htmlEqual(target.innerHTML, ``); | ||
} | ||
}; |
13 changes: 13 additions & 0 deletions
13
test/runtime/samples/each-block-component-no-props/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,13 @@ | ||
<script> | ||
import Child from './Child.svelte'; | ||
let items = [1]; | ||
export function remove() { | ||
items = []; | ||
} | ||
</script> | ||
|
||
{#each items as item} | ||
<Child/> | ||
{/each} |