mirror of https://github.com/sveltejs/svelte
parent
cedbb28586
commit
1c81f85c11
@ -1 +1 @@
|
||||
<input use:tooltip="t('tooltip msg')">
|
||||
<input use:tooltip="{t('tooltip msg')}">
|
||||
|
@ -1 +1 @@
|
||||
<input use:tooltip="message">
|
||||
<input use:tooltip={message}>
|
||||
|
@ -1 +1 @@
|
||||
<input use:tooltip="'tooltip msg'">
|
||||
<input use:tooltip="{'tooltip msg'}">
|
||||
|
@ -1,9 +1,9 @@
|
||||
<script>
|
||||
export default {
|
||||
oncreate() {
|
||||
import('./foo.js').then(foo => {
|
||||
console.log(foo.default);
|
||||
});
|
||||
}
|
||||
}
|
||||
import { onMount } from 'svelte';
|
||||
|
||||
onMount(() => {
|
||||
import('./foo.js').then(foo => {
|
||||
console.log(foo.default);
|
||||
});
|
||||
});
|
||||
</script>
|
@ -1,10 +0,0 @@
|
||||
{
|
||||
"code": "invalid-directive-value",
|
||||
"message": "directive values should not be wrapped — use 'foo', not '{foo}'",
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 19,
|
||||
"character": 19
|
||||
},
|
||||
"pos": 19
|
||||
}
|
@ -1 +0,0 @@
|
||||
<input bind:value='{foo}'>
|
@ -1,10 +0,0 @@
|
||||
{
|
||||
"code": "invalid-directive-value",
|
||||
"message": "Can only bind to an identifier (e.g. `foo`) or a member expression (e.g. `foo.bar` or `foo[baz]`)",
|
||||
"pos": 19,
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 19,
|
||||
"character": 19
|
||||
}
|
||||
}
|
@ -1 +0,0 @@
|
||||
<input bind:value='a + b'>
|
@ -1,10 +0,0 @@
|
||||
{
|
||||
"code": "invalid-directive-value",
|
||||
"message": "Expected a method call",
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 15,
|
||||
"character": 15
|
||||
},
|
||||
"pos": 15
|
||||
}
|
@ -1 +0,0 @@
|
||||
<div on:click='foo'></div>
|
@ -1,10 +0,0 @@
|
||||
{
|
||||
"code": "invalid-directive-value",
|
||||
"message": "ref directives cannot have a value",
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 14,
|
||||
"character": 14
|
||||
},
|
||||
"pos": 14
|
||||
}
|
@ -1 +0,0 @@
|
||||
<div ref:foo='bar'></div>
|
@ -1,5 +1,5 @@
|
||||
<div></div>
|
||||
|
||||
<script>
|
||||
// TODO write some code
|
||||
</script>
|
||||
|
||||
<div></div>
|
@ -1,25 +1,27 @@
|
||||
{
|
||||
"html": {
|
||||
"start": 0,
|
||||
"end": 11,
|
||||
"start": 45,
|
||||
"end": 56,
|
||||
"type": "Fragment",
|
||||
"children": [
|
||||
{
|
||||
"start": 0,
|
||||
"end": 11,
|
||||
"start": 43,
|
||||
"end": 45,
|
||||
"type": "Text",
|
||||
"data": "\n\n"
|
||||
},
|
||||
{
|
||||
"start": 45,
|
||||
"end": 56,
|
||||
"type": "Element",
|
||||
"name": "div",
|
||||
"attributes": [],
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"start": 11,
|
||||
"end": 13,
|
||||
"type": "Text",
|
||||
"data": "\n\n"
|
||||
}
|
||||
]
|
||||
},
|
||||
"css": null,
|
||||
"js": null
|
||||
"css": [],
|
||||
"js": [
|
||||
null
|
||||
]
|
||||
}
|
@ -1,13 +1,9 @@
|
||||
<h1>Hello {name}!</h1>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data: () => ({
|
||||
name: 'world'
|
||||
})
|
||||
};
|
||||
let name = 'world';
|
||||
|
||||
/*
|
||||
trailing multiline comment
|
||||
*/
|
||||
</script>
|
||||
|
||||
<h1>Hello {name}!</h1>
|
||||
|
@ -1,127 +1,89 @@
|
||||
{
|
||||
"html": {
|
||||
"start": 0,
|
||||
"end": 22,
|
||||
"start": 79,
|
||||
"end": 101,
|
||||
"type": "Fragment",
|
||||
"children": [
|
||||
{
|
||||
"start": 0,
|
||||
"end": 22,
|
||||
"start": 77,
|
||||
"end": 79,
|
||||
"type": "Text",
|
||||
"data": "\n\n"
|
||||
},
|
||||
{
|
||||
"start": 79,
|
||||
"end": 101,
|
||||
"type": "Element",
|
||||
"name": "h1",
|
||||
"attributes": [],
|
||||
"children": [
|
||||
{
|
||||
"start": 4,
|
||||
"end": 10,
|
||||
"start": 83,
|
||||
"end": 89,
|
||||
"type": "Text",
|
||||
"data": "Hello "
|
||||
},
|
||||
{
|
||||
"start": 10,
|
||||
"end": 16,
|
||||
"start": 89,
|
||||
"end": 95,
|
||||
"type": "MustacheTag",
|
||||
"expression": {
|
||||
"type": "Identifier",
|
||||
"start": 11,
|
||||
"end": 15,
|
||||
"start": 90,
|
||||
"end": 94,
|
||||
"name": "name"
|
||||
}
|
||||
},
|
||||
{
|
||||
"start": 16,
|
||||
"end": 17,
|
||||
"start": 95,
|
||||
"end": 96,
|
||||
"type": "Text",
|
||||
"data": "!"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"start": 22,
|
||||
"end": 24,
|
||||
"type": "Text",
|
||||
"data": "\n\n"
|
||||
}
|
||||
]
|
||||
},
|
||||
"css": null,
|
||||
"js": {
|
||||
"start": 24,
|
||||
"end": 141,
|
||||
"attributes": [],
|
||||
"content": {
|
||||
"type": "Program",
|
||||
"start": 32,
|
||||
"end": 132,
|
||||
"body": [
|
||||
{
|
||||
"type": "ExportDefaultDeclaration",
|
||||
"start": 34,
|
||||
"end": 93,
|
||||
"declaration": {
|
||||
"type": "ObjectExpression",
|
||||
"start": 49,
|
||||
"end": 92,
|
||||
"properties": [
|
||||
"css": [],
|
||||
"js": [
|
||||
{
|
||||
"start": 0,
|
||||
"end": 77,
|
||||
"attributes": [],
|
||||
"content": {
|
||||
"type": "Program",
|
||||
"start": 8,
|
||||
"end": 68,
|
||||
"body": [
|
||||
{
|
||||
"type": "VariableDeclaration",
|
||||
"start": 10,
|
||||
"end": 29,
|
||||
"declarations": [
|
||||
{
|
||||
"type": "Property",
|
||||
"start": 53,
|
||||
"end": 89,
|
||||
"method": false,
|
||||
"shorthand": false,
|
||||
"computed": false,
|
||||
"key": {
|
||||
"type": "VariableDeclarator",
|
||||
"start": 14,
|
||||
"end": 28,
|
||||
"id": {
|
||||
"type": "Identifier",
|
||||
"start": 53,
|
||||
"end": 57,
|
||||
"name": "data"
|
||||
},
|
||||
"value": {
|
||||
"type": "ArrowFunctionExpression",
|
||||
"start": 59,
|
||||
"end": 89,
|
||||
"id": null,
|
||||
"generator": false,
|
||||
"expression": true,
|
||||
"async": false,
|
||||
"params": [],
|
||||
"body": {
|
||||
"type": "ObjectExpression",
|
||||
"start": 66,
|
||||
"end": 88,
|
||||
"properties": [
|
||||
{
|
||||
"type": "Property",
|
||||
"start": 71,
|
||||
"end": 84,
|
||||
"method": false,
|
||||
"shorthand": false,
|
||||
"computed": false,
|
||||
"key": {
|
||||
"type": "Identifier",
|
||||
"start": 71,
|
||||
"end": 75,
|
||||
"name": "name"
|
||||
},
|
||||
"value": {
|
||||
"type": "Literal",
|
||||
"start": 77,
|
||||
"end": 84,
|
||||
"value": "world",
|
||||
"raw": "'world'"
|
||||
},
|
||||
"kind": "init"
|
||||
}
|
||||
]
|
||||
}
|
||||
"start": 14,
|
||||
"end": 18,
|
||||
"name": "name"
|
||||
},
|
||||
"kind": "init"
|
||||
"init": {
|
||||
"type": "Literal",
|
||||
"start": 21,
|
||||
"end": 28,
|
||||
"value": "world",
|
||||
"raw": "'world'"
|
||||
}
|
||||
}
|
||||
]
|
||||
],
|
||||
"kind": "let"
|
||||
}
|
||||
}
|
||||
],
|
||||
"sourceType": "module"
|
||||
],
|
||||
"sourceType": "module"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
@ -1,11 +1,7 @@
|
||||
<h1>Hello {name}!</h1>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data: () => ({
|
||||
name: 'world'
|
||||
})
|
||||
};
|
||||
let name = 'world';
|
||||
|
||||
// trailing line comment
|
||||
</script>
|
||||
|
||||
<h1>Hello {name}!</h1>
|
||||
|
@ -1,127 +1,89 @@
|
||||
{
|
||||
"html": {
|
||||
"start": 0,
|
||||
"end": 22,
|
||||
"start": 68,
|
||||
"end": 90,
|
||||
"type": "Fragment",
|
||||
"children": [
|
||||
{
|
||||
"start": 0,
|
||||
"end": 22,
|
||||
"start": 66,
|
||||
"end": 68,
|
||||
"type": "Text",
|
||||
"data": "\n\n"
|
||||
},
|
||||
{
|
||||
"start": 68,
|
||||
"end": 90,
|
||||
"type": "Element",
|
||||
"name": "h1",
|
||||
"attributes": [],
|
||||
"children": [
|
||||
{
|
||||
"start": 4,
|
||||
"end": 10,
|
||||
"start": 72,
|
||||
"end": 78,
|
||||
"type": "Text",
|
||||
"data": "Hello "
|
||||
},
|
||||
{
|
||||
"start": 10,
|
||||
"end": 16,
|
||||
"start": 78,
|
||||
"end": 84,
|
||||
"type": "MustacheTag",
|
||||
"expression": {
|
||||
"type": "Identifier",
|
||||
"start": 11,
|
||||
"end": 15,
|
||||
"start": 79,
|
||||
"end": 83,
|
||||
"name": "name"
|
||||
}
|
||||
},
|
||||
{
|
||||
"start": 16,
|
||||
"end": 17,
|
||||
"start": 84,
|
||||
"end": 85,
|
||||
"type": "Text",
|
||||
"data": "!"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"start": 22,
|
||||
"end": 24,
|
||||
"type": "Text",
|
||||
"data": "\n\n"
|
||||
}
|
||||
]
|
||||
},
|
||||
"css": null,
|
||||
"js": {
|
||||
"start": 24,
|
||||
"end": 130,
|
||||
"attributes": [],
|
||||
"content": {
|
||||
"type": "Program",
|
||||
"start": 32,
|
||||
"end": 121,
|
||||
"body": [
|
||||
{
|
||||
"type": "ExportDefaultDeclaration",
|
||||
"start": 34,
|
||||
"end": 93,
|
||||
"declaration": {
|
||||
"type": "ObjectExpression",
|
||||
"start": 49,
|
||||
"end": 92,
|
||||
"properties": [
|
||||
"css": [],
|
||||
"js": [
|
||||
{
|
||||
"start": 0,
|
||||
"end": 66,
|
||||
"attributes": [],
|
||||
"content": {
|
||||
"type": "Program",
|
||||
"start": 8,
|
||||
"end": 57,
|
||||
"body": [
|
||||
{
|
||||
"type": "VariableDeclaration",
|
||||
"start": 10,
|
||||
"end": 29,
|
||||
"declarations": [
|
||||
{
|
||||
"type": "Property",
|
||||
"start": 53,
|
||||
"end": 89,
|
||||
"method": false,
|
||||
"shorthand": false,
|
||||
"computed": false,
|
||||
"key": {
|
||||
"type": "VariableDeclarator",
|
||||
"start": 14,
|
||||
"end": 28,
|
||||
"id": {
|
||||
"type": "Identifier",
|
||||
"start": 53,
|
||||
"end": 57,
|
||||
"name": "data"
|
||||
},
|
||||
"value": {
|
||||
"type": "ArrowFunctionExpression",
|
||||
"start": 59,
|
||||
"end": 89,
|
||||
"id": null,
|
||||
"generator": false,
|
||||
"expression": true,
|
||||
"async": false,
|
||||
"params": [],
|
||||
"body": {
|
||||
"type": "ObjectExpression",
|
||||
"start": 66,
|
||||
"end": 88,
|
||||
"properties": [
|
||||
{
|
||||
"type": "Property",
|
||||
"start": 71,
|
||||
"end": 84,
|
||||
"method": false,
|
||||
"shorthand": false,
|
||||
"computed": false,
|
||||
"key": {
|
||||
"type": "Identifier",
|
||||
"start": 71,
|
||||
"end": 75,
|
||||
"name": "name"
|
||||
},
|
||||
"value": {
|
||||
"type": "Literal",
|
||||
"start": 77,
|
||||
"end": 84,
|
||||
"value": "world",
|
||||
"raw": "'world'"
|
||||
},
|
||||
"kind": "init"
|
||||
}
|
||||
]
|
||||
}
|
||||
"start": 14,
|
||||
"end": 18,
|
||||
"name": "name"
|
||||
},
|
||||
"kind": "init"
|
||||
"init": {
|
||||
"type": "Literal",
|
||||
"start": 21,
|
||||
"end": 28,
|
||||
"value": "world",
|
||||
"raw": "'world'"
|
||||
}
|
||||
}
|
||||
]
|
||||
],
|
||||
"kind": "let"
|
||||
}
|
||||
}
|
||||
],
|
||||
"sourceType": "module"
|
||||
],
|
||||
"sourceType": "module"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
@ -1,9 +1,5 @@
|
||||
<h1>Hello {name}!</h1>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data: () => ({
|
||||
name: 'world'
|
||||
})
|
||||
};
|
||||
let name = 'world';
|
||||
</script>
|
||||
|
||||
<h1>Hello {name}!</h1>
|
@ -1,127 +1,89 @@
|
||||
{
|
||||
"html": {
|
||||
"start": 0,
|
||||
"end": 22,
|
||||
"start": 41,
|
||||
"end": 63,
|
||||
"type": "Fragment",
|
||||
"children": [
|
||||
{
|
||||
"start": 0,
|
||||
"end": 22,
|
||||
"start": 39,
|
||||
"end": 41,
|
||||
"type": "Text",
|
||||
"data": "\n\n"
|
||||
},
|
||||
{
|
||||
"start": 41,
|
||||
"end": 63,
|
||||
"type": "Element",
|
||||
"name": "h1",
|
||||
"attributes": [],
|
||||
"children": [
|
||||
{
|
||||
"start": 4,
|
||||
"end": 10,
|
||||
"start": 45,
|
||||
"end": 51,
|
||||
"type": "Text",
|
||||
"data": "Hello "
|
||||
},
|
||||
{
|
||||
"start": 10,
|
||||
"end": 16,
|
||||
"start": 51,
|
||||
"end": 57,
|
||||
"type": "MustacheTag",
|
||||
"expression": {
|
||||
"type": "Identifier",
|
||||
"start": 11,
|
||||
"end": 15,
|
||||
"start": 52,
|
||||
"end": 56,
|
||||
"name": "name"
|
||||
}
|
||||
},
|
||||
{
|
||||
"start": 16,
|
||||
"end": 17,
|
||||
"start": 57,
|
||||
"end": 58,
|
||||
"type": "Text",
|
||||
"data": "!"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"start": 22,
|
||||
"end": 24,
|
||||
"type": "Text",
|
||||
"data": "\n\n"
|
||||
}
|
||||
]
|
||||
},
|
||||
"css": null,
|
||||
"js": {
|
||||
"start": 24,
|
||||
"end": 103,
|
||||
"attributes": [],
|
||||
"content": {
|
||||
"type": "Program",
|
||||
"start": 32,
|
||||
"end": 94,
|
||||
"body": [
|
||||
{
|
||||
"type": "ExportDefaultDeclaration",
|
||||
"start": 34,
|
||||
"end": 93,
|
||||
"declaration": {
|
||||
"type": "ObjectExpression",
|
||||
"start": 49,
|
||||
"end": 92,
|
||||
"properties": [
|
||||
"css": [],
|
||||
"js": [
|
||||
{
|
||||
"start": 0,
|
||||
"end": 39,
|
||||
"attributes": [],
|
||||
"content": {
|
||||
"type": "Program",
|
||||
"start": 8,
|
||||
"end": 30,
|
||||
"body": [
|
||||
{
|
||||
"type": "VariableDeclaration",
|
||||
"start": 10,
|
||||
"end": 29,
|
||||
"declarations": [
|
||||
{
|
||||
"type": "Property",
|
||||
"start": 53,
|
||||
"end": 89,
|
||||
"method": false,
|
||||
"shorthand": false,
|
||||
"computed": false,
|
||||
"key": {
|
||||
"type": "VariableDeclarator",
|
||||
"start": 14,
|
||||
"end": 28,
|
||||
"id": {
|
||||
"type": "Identifier",
|
||||
"start": 53,
|
||||
"end": 57,
|
||||
"name": "data"
|
||||
},
|
||||
"value": {
|
||||
"type": "ArrowFunctionExpression",
|
||||
"start": 59,
|
||||
"end": 89,
|
||||
"id": null,
|
||||
"generator": false,
|
||||
"expression": true,
|
||||
"async": false,
|
||||
"params": [],
|
||||
"body": {
|
||||
"type": "ObjectExpression",
|
||||
"start": 66,
|
||||
"end": 88,
|
||||
"properties": [
|
||||
{
|
||||
"type": "Property",
|
||||
"start": 71,
|
||||
"end": 84,
|
||||
"method": false,
|
||||
"shorthand": false,
|
||||
"computed": false,
|
||||
"key": {
|
||||
"type": "Identifier",
|
||||
"start": 71,
|
||||
"end": 75,
|
||||
"name": "name"
|
||||
},
|
||||
"value": {
|
||||
"type": "Literal",
|
||||
"start": 77,
|
||||
"end": 84,
|
||||
"value": "world",
|
||||
"raw": "'world'"
|
||||
},
|
||||
"kind": "init"
|
||||
}
|
||||
]
|
||||
}
|
||||
"start": 14,
|
||||
"end": 18,
|
||||
"name": "name"
|
||||
},
|
||||
"kind": "init"
|
||||
"init": {
|
||||
"type": "Literal",
|
||||
"start": 21,
|
||||
"end": 28,
|
||||
"value": "world",
|
||||
"raw": "'world'"
|
||||
}
|
||||
}
|
||||
]
|
||||
],
|
||||
"kind": "let"
|
||||
}
|
||||
}
|
||||
],
|
||||
"sourceType": "module"
|
||||
],
|
||||
"sourceType": "module"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
@ -1 +1 @@
|
||||
<div in:style='{opacity: 0}'>fades in</div>
|
||||
<div in:style="{{opacity: 0}}">fades in</div>
|
Loading…
Reference in new issue