第一次尝试:
<button type="submit" class="button" {{#if isDirty(item)}}disabled{{/if}}>Save2</button>
在编译期间导致错误:
bundling...
(svelte plugin) Error: (28:75) Expected >
26: <div class="row">
27: <!-- FIXME Can't set an attribute dynamically? -->
28: <button type="submit" class="button" {{#if isDirty(item)}}disabled{{/if}}>Save2</button>
^
我能想到的最好的:
{{#if isDirty(item)}}
<button type="submit" class="button" disabled>Save</button>
{{else}}
<button type="submit" class="button">Save</button>
{{/if}}