diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2022-08-31 00:24:33 +0900 |
|---|---|---|
| committer | syuilo <Syuilotan@yahoo.co.jp> | 2022-08-31 00:24:33 +0900 |
| commit | 786b150ea75111b5f6102c256d5cfa42cb83d1fb (patch) | |
| tree | d552d0c371829d7ff027890d1036a80bb08517f7 /packages/client/src/components/MkKeyValue.vue | |
| parent | update deps (diff) | |
| download | sharkey-786b150ea75111b5f6102c256d5cfa42cb83d1fb.tar.gz sharkey-786b150ea75111b5f6102c256d5cfa42cb83d1fb.tar.bz2 sharkey-786b150ea75111b5f6102c256d5cfa42cb83d1fb.zip | |
refactor(client): align filename to component name
Diffstat (limited to 'packages/client/src/components/MkKeyValue.vue')
| -rw-r--r-- | packages/client/src/components/MkKeyValue.vue | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/packages/client/src/components/MkKeyValue.vue b/packages/client/src/components/MkKeyValue.vue new file mode 100644 index 0000000000..586f7a3f9d --- /dev/null +++ b/packages/client/src/components/MkKeyValue.vue @@ -0,0 +1,58 @@ +<template> +<div class="alqyeyti" :class="{ oneline }"> + <div class="key"> + <slot name="key"></slot> + </div> + <div class="value"> + <slot name="value"></slot> + <button v-if="copy" v-tooltip="i18n.ts.copy" class="_textButton" style="margin-left: 0.5em;" @click="copy_"><i class="far fa-copy"></i></button> + </div> +</div> +</template> + +<script lang="ts" setup> +import { } from 'vue'; +import copyToClipboard from '@/scripts/copy-to-clipboard'; +import * as os from '@/os'; +import { i18n } from '@/i18n'; + +const props = withDefaults(defineProps<{ + copy?: string | null; + oneline?: boolean; +}>(), { + copy: null, + oneline: false, +}); + +const copy_ = () => { + copyToClipboard(props.copy); + os.success(); +}; +</script> + +<style lang="scss" scoped> +.alqyeyti { + > .key { + font-size: 0.85em; + padding: 0 0 0.25em 0; + opacity: 0.75; + } + + &.oneline { + display: flex; + + > .key { + width: 30%; + font-size: 1em; + padding: 0 8px 0 0; + } + + > .value { + width: 70%; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + } + } +} +</style> |