remove if/each slot special check

pull/4509/head
Tan Li Hau 6 years ago
parent b43cf2da32
commit 6f634b8fc6

@ -395,16 +395,6 @@ export default class Element extends Node {
component.slot_outlets.add(name); component.slot_outlets.add(name);
} }
if (parent.type === 'IfBlock' || parent.type === 'EachBlock') {
const type = parent.type === 'IfBlock' ? 'if' : 'each';
const message = `Cannot place slotted elements inside an ${type}-block`;
component.error(attribute, {
code: `invalid-slotted-content`,
message
});
}
if (!(parent.type === 'InlineComponent' || (parent.type === 'Element' && /-/.test(parent.name)))) { if (!(parent.type === 'InlineComponent' || (parent.type === 'Element' && /-/.test(parent.name)))) {
component.error(attribute, { component.error(attribute, {
code: `invalid-slotted-content`, code: `invalid-slotted-content`,

@ -1,6 +1,6 @@
[{ [{
"code": "invalid-slotted-content", "code": "invalid-slotted-content",
"message": "Cannot place slotted elements inside an each-block", "message": "Element with a slot='...' attribute must be a child of a component or custom element",
"start": { "start": {
"line": 7, "line": 7,
"column": 7, "column": 7,

@ -1,6 +1,6 @@
[{ [{
"code": "invalid-slotted-content", "code": "invalid-slotted-content",
"message": "Cannot place slotted elements inside an if-block", "message": "Element with a slot='...' attribute must be a child of a component or custom element",
"start": { "start": {
"line": 7, "line": 7,
"column": 7, "column": 7,

Loading…
Cancel
Save