mirror of https://github.com/sveltejs/svelte
parent
e21488fc4b
commit
b1b51a404b
@ -0,0 +1,5 @@
|
||||
---
|
||||
"svelte": patch
|
||||
---
|
||||
|
||||
fix: deduplicate generated props and action arg names
|
@ -0,0 +1,14 @@
|
||||
import { tick } from 'svelte';
|
||||
import { test } from '../../test';
|
||||
|
||||
export default test({
|
||||
accessors: false,
|
||||
async test({ assert, target }) {
|
||||
assert.htmlEqual(target.innerHTML, '<button>foo / foo</button><div></div>');
|
||||
|
||||
const button = target.querySelector('button');
|
||||
button?.click();
|
||||
await tick();
|
||||
assert.htmlEqual(target.innerHTML, '<button>bar / bar</button><div></div>');
|
||||
}
|
||||
});
|
@ -0,0 +1,17 @@
|
||||
<script>
|
||||
import Component from "./sub.svelte"
|
||||
let state = 'foo';
|
||||
let param = '';
|
||||
|
||||
function action(node, _param) {
|
||||
param = _param
|
||||
return {
|
||||
update(_param) {
|
||||
param = _param;
|
||||
}
|
||||
};
|
||||
}
|
||||
</script>
|
||||
|
||||
<button on:click={() => state = 'bar'}>{state} / {param}</button>
|
||||
<Component {action} {state}></Component>
|
@ -0,0 +1,6 @@
|
||||
<script>
|
||||
export let action;
|
||||
export let state;
|
||||
</script>
|
||||
|
||||
<div use:action={state}></div>
|
Loading…
Reference in new issue