mirror of https://github.com/sveltejs/svelte
recognise dependencies in class directives - fixes #1793
parent
1deb25e184
commit
3258779fa7
@ -0,0 +1,21 @@
|
||||
export default {
|
||||
data: {
|
||||
things: ['one', 'two', 'three'],
|
||||
selected: 'two'
|
||||
},
|
||||
|
||||
html: `
|
||||
<div></div>
|
||||
<div class="selected"></div>
|
||||
<div></div>
|
||||
`,
|
||||
|
||||
test(assert, component, target) {
|
||||
component.set({ selected: 'three' });
|
||||
assert.htmlEqual(target.innerHTML, `
|
||||
<div></div>
|
||||
<div class=""></div>
|
||||
<div class="selected"></div>
|
||||
`);
|
||||
}
|
||||
};
|
@ -0,0 +1,3 @@
|
||||
{#each things as thing}
|
||||
<div class:selected="selected === thing"></div>
|
||||
{/each}
|
Loading…
Reference in new issue