1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-05-30 21:33:56 +02:00

refactor(client):

This commit is contained in:
syuilo
2022-07-20 22:24:26 +09:00
parent 9a1f5afde9
commit 50e3ca19bc
92 changed files with 793 additions and 756 deletions

View File

@@ -1,11 +1,12 @@
<template>
<MkContainer :show-header="widgetProps.showHeader" :naked="widgetProps.transparent" :class="$style.root" :data-transparent="widgetProps.transparent ? true : null" class="mkw-photos">
<template #header><i class="fas fa-camera"></i>{{ $ts._widgets.photos }}</template>
<template #header><i class="fas fa-camera"></i>{{ i18n.ts._widgets.photos }}</template>
<div class="">
<MkLoading v-if="fetching"/>
<div v-else :class="$style.stream">
<div v-for="(image, i) in images" :key="i"
<div
v-for="(image, i) in images" :key="i"
:class="$style.img"
:style="`background-image: url(${thumbnail(image)})`"
></div>
@@ -16,13 +17,14 @@
<script lang="ts" setup>
import { onMounted, onUnmounted, reactive, ref } from 'vue';
import { GetFormResultType } from '@/scripts/form';
import { useWidgetPropsManager, Widget, WidgetComponentEmits, WidgetComponentExpose, WidgetComponentProps } from './widget';
import { GetFormResultType } from '@/scripts/form';
import { stream } from '@/stream';
import { getStaticImageUrl } from '@/scripts/get-static-image-url';
import * as os from '@/os';
import MkContainer from '@/components/ui/container.vue';
import { defaultStore } from '@/store';
import { i18n } from '@/i18n';
const name = 'photos';
@@ -70,7 +72,7 @@ const thumbnail = (image: any): string => {
os.api('drive/stream', {
type: 'image/*',
limit: 9
limit: 9,
}).then(res => {
images.value = res;
fetching.value = false;