Skip to content

Commit

Permalink
docs(site): add tooltip for example code actions (#1784)
Browse files Browse the repository at this point in the history
* docs(site): add tooltip for example code actions

* test(date-picker): remove reset case
  • Loading branch information
chouchouji authored Sep 26, 2024
1 parent 8ee1048 commit 095166a
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 920 deletions.
40 changes: 23 additions & 17 deletions packages/varlet-cli/site/pc/components/code-example/CodeExample.vue
Original file line number Diff line number Diff line change
@@ -1,23 +1,29 @@
<template>
<div class="var-site-code-example">
<div class="var-site-code-example__toolbar">
<var-button text round @click="toggle" v-if="fold && !disabledFold">
<var-icon name="xml" size="18" />
</var-button>

<var-button
:id="`clip-trigger-${cid}`"
:data-clipboard-target="`#clip-target-${cid}`"
text
round
v-if="clipboard"
>
<var-icon name="content-copy" size="18" />
</var-button>

<var-button text round @click="toPlayground" v-if="playground">
<var-icon name="code-json" size="18" />
</var-button>
<var-tooltip placement="top" :content="height >= 0 ? 'Show Source' : 'Hide Source'">
<var-button text round @click="toggle" v-if="fold && !disabledFold">
<var-icon name="xml" size="18" />
</var-button>
</var-tooltip>

<var-tooltip placement="top" content="Copy Example Code">
<var-button
:id="`clip-trigger-${cid}`"
:data-clipboard-target="`#clip-target-${cid}`"
text
round
v-if="clipboard"
>
<var-icon name="content-copy" size="18" />
</var-button>
</var-tooltip>

<var-tooltip placement="top" content="Edit In Playground">
<var-button text round @click="toPlayground" v-if="playground">
<var-icon name="code-json" size="18" />
</var-button>
</var-tooltip>
</div>
<div
:id="`clip-target-${cid}`"
Expand Down
Loading

0 comments on commit 095166a

Please sign in to comment.