mirror of https://github.com/sveltejs/svelte
fix deep object property as action (#5845)
parent
08cb3142e9
commit
1da4105d65
@ -0,0 +1,8 @@
|
||||
export default {
|
||||
html: `
|
||||
<button>action</button>
|
||||
`,
|
||||
async test({ assert, target, window }) {
|
||||
assert.equal(target.querySelector('button').foo, 'bar1337');
|
||||
}
|
||||
};
|
@ -0,0 +1,12 @@
|
||||
<script>
|
||||
const obj = {
|
||||
deep: {
|
||||
foo : 'bar',
|
||||
action(element, { leet }) {
|
||||
element.foo = this.foo + leet;
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<button use:obj.deep.action={{ leet: 1337 }}>action</button>
|
Loading…
Reference in new issue