mirror of
https://github.com/misskey-dev/misskey.git
synced 2024-12-21 06:45:09 +01:00
15761a0fa8
* ✌️ * fix * ✌️ * 422px上限 * 334 * min-height: 130px * 64px * fix * wip * ✌️ * fix * max-height: none * MkImgWithBlurHashでratioを計算する * wip * fix * fix? * Revert "fix?" This reverts commite39d832dd1
. * Revert "fix" This reverts commit15be36ba55
. * Revert "wip" This reverts commitaf7d86f69d
. * fix * Revert "Revert "wip"" This reverts commitbb0036ae22
. * Revert "Revert "fix"" This reverts commitc1d94a45c5
. * Revert "Revert "fix?"" This reverts commit9cb4fbfd96
. * fix * use clamp * readable * add 1:1, 3:4 * moveComment * 3:4 → 2:3 * fix * default * fallback * Revert "fallback" This reverts commit741717dd49
. * Fix?(server): Content-Dispositionのパースでエラーが発生した場合にもダウンロードが完了するように #10626
85 lines
1.6 KiB
Vue
85 lines
1.6 KiB
Vue
<script lang="ts">
|
|
import { VNode, defineComponent, h } from 'vue';
|
|
import MkRadio from './MkRadio.vue';
|
|
|
|
export default defineComponent({
|
|
components: {
|
|
MkRadio,
|
|
},
|
|
props: {
|
|
modelValue: {
|
|
required: false,
|
|
},
|
|
},
|
|
data() {
|
|
return {
|
|
value: this.modelValue,
|
|
};
|
|
},
|
|
watch: {
|
|
value() {
|
|
this.$emit('update:modelValue', this.value);
|
|
},
|
|
},
|
|
render() {
|
|
console.log(this.$slots, this.$slots.label && this.$slots.label());
|
|
if (!this.$slots.default) return null;
|
|
let options = this.$slots.default();
|
|
const label = this.$slots.label && this.$slots.label();
|
|
const caption = this.$slots.caption && this.$slots.caption();
|
|
|
|
// なぜかFragmentになることがあるため
|
|
if (options.length === 1 && options[0].props == null) options = options[0].children as VNode[];
|
|
|
|
return h('div', {
|
|
class: 'novjtcto',
|
|
}, [
|
|
...(label ? [h('div', {
|
|
class: 'label',
|
|
}, label)] : []),
|
|
h('div', {
|
|
class: 'body',
|
|
}, options.map(option => h(MkRadio, {
|
|
key: option.key,
|
|
value: option.props?.value,
|
|
modelValue: this.value,
|
|
'onUpdate:modelValue': value => this.value = value,
|
|
}, () => option.children)),
|
|
),
|
|
...(caption ? [h('div', {
|
|
class: 'caption',
|
|
}, caption)] : []),
|
|
]);
|
|
},
|
|
});
|
|
</script>
|
|
|
|
<style lang="scss">
|
|
.novjtcto {
|
|
> .label {
|
|
font-size: 0.85em;
|
|
padding: 0 0 8px 0;
|
|
user-select: none;
|
|
|
|
&:empty {
|
|
display: none;
|
|
}
|
|
}
|
|
|
|
> .body {
|
|
display: flex;
|
|
gap: 12px;
|
|
flex-wrap: wrap;
|
|
}
|
|
|
|
> .caption {
|
|
font-size: 0.85em;
|
|
padding: 8px 0 0 0;
|
|
color: var(--fgTransparentWeak);
|
|
|
|
&:empty {
|
|
display: none;
|
|
}
|
|
}
|
|
}
|
|
</style>
|