mirror of https://github.com/sveltejs/svelte
Merge pull request #1905 from sveltejs/hash-in-dynamic-attribute
only apply aliasing logic oncepull/1907/head
commit
6def7ca69b
@ -0,0 +1,26 @@
|
||||
export default {
|
||||
preserveIdentifiers: true,
|
||||
|
||||
props: {
|
||||
links: ['a', 'b', 'c']
|
||||
},
|
||||
|
||||
html: `
|
||||
<a href="x#a">x#a</a>
|
||||
<a href="x#b">x#b</a>
|
||||
<a href="x#c">x#c</a>
|
||||
`,
|
||||
|
||||
test({ assert, component, target }) {
|
||||
component.links = ['d', 'e', 'f'];
|
||||
|
||||
const links = [...target.querySelectorAll('a')];
|
||||
assert.deepEqual(links.map(l => l.href), ['x#d', 'x#e', 'x#f']);
|
||||
|
||||
assert.htmlEqual(target.innerHTML, `
|
||||
<a href="x#d">x#d</a>
|
||||
<a href="x#e">x#e</a>
|
||||
<a href="x#f">x#f</a>
|
||||
`);
|
||||
}
|
||||
};
|
@ -0,0 +1,3 @@
|
||||
{#each links as link}
|
||||
<a href="x#{link}">x#{link}</a>
|
||||
{/each}
|
Loading…
Reference in new issue