mirror of
https://github.com/CorentinTh/it-tools.git
synced 2025-05-06 22:37:12 -04:00
feat: git memo
Signed-off-by: Corentin Thomasset <corentin.thomasset74@gmail.com>
This commit is contained in:
parent
c8c0dceb21
commit
cb0e3f91db
6 changed files with 265 additions and 0 deletions
43
src/components/CopyableCodeContent.vue
Normal file
43
src/components/CopyableCodeContent.vue
Normal file
|
@ -0,0 +1,43 @@
|
|||
<template>
|
||||
<div class="copyable-code-content" @click="copy($slots.default[0].text)">
|
||||
<pre class="pretty-scrollbar"><slot></slot></pre>
|
||||
<v-icon>far fa-copy</v-icon>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {copyable} from "../mixins/copyable.mixin";
|
||||
|
||||
export default {
|
||||
name: "CopyableCodeContent",
|
||||
mixins: [copyable]
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.copyable-code-content {
|
||||
cursor: pointer;
|
||||
background-color: rgba(0, 0, 0, 0.1);
|
||||
border-radius: 4px;
|
||||
padding: 8px 15px;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
pre {
|
||||
flex: 1;
|
||||
overflow-x: auto;
|
||||
}
|
||||
|
||||
.v-icon {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
.v-icon {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
Loading…
Add table
Add a link
Reference in a new issue