mirror of https://github.com/sveltejs/svelte
commit
319b3b6765
@ -0,0 +1,14 @@
|
|||||||
|
export default {
|
||||||
|
data: {
|
||||||
|
depth: 5
|
||||||
|
},
|
||||||
|
|
||||||
|
html: `
|
||||||
|
<span>5</span>
|
||||||
|
<span>4</span>
|
||||||
|
<span>3</span>
|
||||||
|
<span>2</span>
|
||||||
|
<span>1</span>
|
||||||
|
<span>0</span>
|
||||||
|
`
|
||||||
|
};
|
@ -0,0 +1,4 @@
|
|||||||
|
<span>{{depth}}</span>
|
||||||
|
{{#if depth > 0}}
|
||||||
|
<:Self depth='{{depth - 1}}'/>
|
||||||
|
{{/if}}
|
@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"message": "<:Self> components can only exist inside if-blocks or each-blocks",
|
||||||
|
"loc": {
|
||||||
|
"line": 1,
|
||||||
|
"column": 1
|
||||||
|
},
|
||||||
|
"pos": 1
|
||||||
|
}
|
@ -0,0 +1 @@
|
|||||||
|
<:Self/>
|
@ -0,0 +1,3 @@
|
|||||||
|
{{#if depth > 1}}
|
||||||
|
<:Self depth='{{depth - 1}}'/>
|
||||||
|
{{/if}}
|
@ -0,0 +1,79 @@
|
|||||||
|
{
|
||||||
|
"hash": 1792372370,
|
||||||
|
"html": {
|
||||||
|
"start": 0,
|
||||||
|
"end": 57,
|
||||||
|
"type": "Fragment",
|
||||||
|
"children": [
|
||||||
|
{
|
||||||
|
"start": 0,
|
||||||
|
"end": 57,
|
||||||
|
"type": "IfBlock",
|
||||||
|
"expression": {
|
||||||
|
"type": "BinaryExpression",
|
||||||
|
"start": 6,
|
||||||
|
"end": 15,
|
||||||
|
"left": {
|
||||||
|
"type": "Identifier",
|
||||||
|
"start": 6,
|
||||||
|
"end": 11,
|
||||||
|
"name": "depth"
|
||||||
|
},
|
||||||
|
"operator": ">",
|
||||||
|
"right": {
|
||||||
|
"type": "Literal",
|
||||||
|
"start": 14,
|
||||||
|
"end": 15,
|
||||||
|
"value": 1,
|
||||||
|
"raw": "1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"children": [
|
||||||
|
{
|
||||||
|
"start": 19,
|
||||||
|
"end": 49,
|
||||||
|
"type": "Element",
|
||||||
|
"name": ":Self",
|
||||||
|
"attributes": [
|
||||||
|
{
|
||||||
|
"start": 26,
|
||||||
|
"end": 47,
|
||||||
|
"type": "Attribute",
|
||||||
|
"name": "depth",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"start": 33,
|
||||||
|
"end": 46,
|
||||||
|
"type": "MustacheTag",
|
||||||
|
"expression": {
|
||||||
|
"type": "BinaryExpression",
|
||||||
|
"start": 35,
|
||||||
|
"end": 44,
|
||||||
|
"left": {
|
||||||
|
"type": "Identifier",
|
||||||
|
"start": 35,
|
||||||
|
"end": 40,
|
||||||
|
"name": "depth"
|
||||||
|
},
|
||||||
|
"operator": "-",
|
||||||
|
"right": {
|
||||||
|
"type": "Literal",
|
||||||
|
"start": 43,
|
||||||
|
"end": 44,
|
||||||
|
"value": 1,
|
||||||
|
"raw": "1"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"children": []
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"css": null,
|
||||||
|
"js": null
|
||||||
|
}
|
Loading…
Reference in new issue