-
-
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.
Browse files
Browse the repository at this point in the history
compile time error on slotted content inside if/each blocks. closes #849
- Loading branch information
Showing
6 changed files
with
68 additions
and
6 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
8 changes: 8 additions & 0 deletions
8
test/validator/samples/component-slotted-each-block/errors.json
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,8 @@ | ||
[{ | ||
"message": "Cannot place slotted elements inside an each-block", | ||
"loc": { | ||
"line": 3, | ||
"column": 7 | ||
}, | ||
"pos": 43 | ||
}] |
15 changes: 15 additions & 0 deletions
15
test/validator/samples/component-slotted-each-block/input.html
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,15 @@ | ||
<Nested> | ||
{{#each things as thing}} | ||
<div slot='foo'>{{thing}}</div> | ||
{{/each}} | ||
</Nested> | ||
|
||
<script> | ||
import Nested from './Nested.html'; | ||
|
||
export default { | ||
components: { | ||
Nested | ||
} | ||
}; | ||
</script> |
8 changes: 8 additions & 0 deletions
8
test/validator/samples/component-slotted-if-block/errors.json
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,8 @@ | ||
[{ | ||
"message": "Cannot place slotted elements inside an if-block", | ||
"loc": { | ||
"line": 3, | ||
"column": 7 | ||
}, | ||
"pos": 31 | ||
}] |
15 changes: 15 additions & 0 deletions
15
test/validator/samples/component-slotted-if-block/input.html
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,15 @@ | ||
<Nested> | ||
{{#if thing}} | ||
<div slot='foo'>{{thing}}</div> | ||
{{/if}} | ||
</Nested> | ||
|
||
<script> | ||
import Nested from './Nested.html'; | ||
|
||
export default { | ||
components: { | ||
Nested | ||
} | ||
}; | ||
</script> |