Skip to content

Commit 79f17e7

Browse files
author
Jesse Haigh
committed
expose CopyState to Vue template
1 parent d8ac2a5 commit 79f17e7

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/components/ContentNode/CodeListing.vue

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,10 @@
3030
:aria-label="$t('icons.copy')"
3131
:title="$t('icons.copy')"
3232
>
33-
<CopyIcon v-if="copyState === 'idle'" class="copy-icon"/>
34-
<CheckmarkIcon v-if="copyState === 'success'" class="checkmark-icon"/>
35-
<CrossIcon v-if="copyState === 'failure'" class="cross-icon"/>
33+
<CopyIcon v-if="copyState === CopyState.idle" class="copy-icon"/>
34+
<CheckmarkIcon v-else-if="copyState === CopyState.success" class="checkmark-icon"/>
35+
<CrossIcon v-else-if="copyState === CopyState.failure" class="cross-icon"/>
36+
3637
</button>
3738
<!-- Do not add newlines in <pre>, as they'll appear in the rendered HTML. -->
3839
<pre><CodeBlock><template
@@ -83,6 +84,7 @@ export default {
8384
return {
8485
syntaxHighlightedLines: [],
8586
copyState: CopyState.idle,
87+
CopyState,
8688
};
8789
},
8890
props: {

0 commit comments

Comments
 (0)