mirror of https://github.com/sveltejs/svelte
Merge pull request #385 from sveltejs/gh-383
allow reserved words in tags e.g. {{class}}pull/394/head
commit
efce7acabe
@ -0,0 +1,14 @@
|
|||||||
|
export default {
|
||||||
|
data: {
|
||||||
|
class: 'foo'
|
||||||
|
},
|
||||||
|
|
||||||
|
html: `<div class="foo"></div>`,
|
||||||
|
|
||||||
|
test ( assert, component, target ) {
|
||||||
|
component.set({ class: 'bar' });
|
||||||
|
assert.equal( target.innerHTML, `<div class="bar"></div>` );
|
||||||
|
|
||||||
|
component.destroy();
|
||||||
|
}
|
||||||
|
};
|
@ -0,0 +1 @@
|
|||||||
|
<div class='{{class}}'></div>
|
@ -0,0 +1 @@
|
|||||||
|
<div class='{{class}}'></div>
|
@ -0,0 +1,40 @@
|
|||||||
|
{
|
||||||
|
"hash": 3305933215,
|
||||||
|
"html": {
|
||||||
|
"start": 0,
|
||||||
|
"end": 29,
|
||||||
|
"type": "Fragment",
|
||||||
|
"children": [
|
||||||
|
{
|
||||||
|
"start": 0,
|
||||||
|
"end": 29,
|
||||||
|
"type": "Element",
|
||||||
|
"name": "div",
|
||||||
|
"attributes": [
|
||||||
|
{
|
||||||
|
"start": 5,
|
||||||
|
"end": 22,
|
||||||
|
"type": "Attribute",
|
||||||
|
"name": "class",
|
||||||
|
"value": [
|
||||||
|
{
|
||||||
|
"start": 12,
|
||||||
|
"end": 21,
|
||||||
|
"type": "MustacheTag",
|
||||||
|
"expression": {
|
||||||
|
"type": "Identifier",
|
||||||
|
"start": 14,
|
||||||
|
"end": 19,
|
||||||
|
"name": "class"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"children": []
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"css": null,
|
||||||
|
"js": null
|
||||||
|
}
|
Loading…
Reference in new issue