misskey/packages/frontend/src/components/form/slot.vue

45 lines
671 B
Vue
Raw Normal View History

<!--
SPDX-FileCopyrightText: syuilo and other misskey contributors
SPDX-License-Identifier: AGPL-3.0-only
-->
2021-09-30 00:50:45 +09:00
<template>
2023-05-24 17:50:15 +09:00
<div>
<div :class="$style.label" @click="focus"><slot name="label"></slot></div>
<div>
2021-09-30 00:50:45 +09:00
<slot></slot>
</div>
2023-05-24 17:50:15 +09:00
<div :class="$style.caption"><slot name="caption"></slot></div>
2021-09-30 00:50:45 +09:00
</div>
</template>
2022-09-05 18:51:23 +09:00
<script lang="ts" setup>
import { } from 'vue';
2021-09-30 00:50:45 +09:00
2022-09-05 18:51:23 +09:00
function focus() {
// TODO
}
2021-09-30 00:50:45 +09:00
</script>
2023-05-24 17:50:15 +09:00
<style lang="scss" module>
.label {
font-size: 0.85em;
padding: 0 0 8px 0;
user-select: none;
2021-09-30 00:50:45 +09:00
2023-05-24 17:50:15 +09:00
&:empty {
display: none;
2021-09-30 00:50:45 +09:00
}
2023-05-24 17:50:15 +09:00
}
2021-09-30 00:50:45 +09:00
2023-05-24 17:50:15 +09:00
.caption {
font-size: 0.85em;
padding: 8px 0 0 0;
color: var(--fgTransparentWeak);
2021-09-30 00:50:45 +09:00
2023-05-24 17:50:15 +09:00
&:empty {
display: none;
2021-09-30 00:50:45 +09:00
}
}
</style>