How to template inline attributes in svelte? -
in repl example, how set style
attribute inline, without needing duplicate anchor tag?
https://svelte.technology/repl?version=1.13.6&gist=0a2bd4376b2fe742fb0d233755c44796
to add zac's answer, add helper function returned style so:
export default { helpers: { getstyle ( page ) { if ( page === 'about' ) return 'color: blue'; return ''; } } };
Comments
Post a Comment