mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-05-31 12:44:05 +02:00
refactor(frontend): 非推奨となったReactivity Transformを使わないように (#12539)
* refactor(frontend): 非推奨となったReactivity Transformを使わないように * refactor: 不要な括弧を除去 * fix: 不要なアノテーションを除去 * fix: Refの配列をrefしている部分の対応 * refactor: 不要な括弧を除去 * fix: lint * refactor: Ref、ShallowRef、ComputedRefの変数の宣言をletからconstに置換 * fix: type error * chore: drop reactivity transform from eslint configuration * refactor: remove unnecessary import * fix: 対応漏れ
This commit is contained in:
@@ -19,7 +19,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { computed, watch } from 'vue';
|
||||
import { computed, watch, ref } from 'vue';
|
||||
import * as Misskey from 'misskey-js';
|
||||
import XFollowList from './follow-list.vue';
|
||||
import * as os from '@/os.js';
|
||||
@@ -31,16 +31,16 @@ const props = withDefaults(defineProps<{
|
||||
}>(), {
|
||||
});
|
||||
|
||||
let user = $ref<null | Misskey.entities.UserDetailed>(null);
|
||||
let error = $ref(null);
|
||||
const user = ref<null | Misskey.entities.UserDetailed>(null);
|
||||
const error = ref(null);
|
||||
|
||||
function fetchUser(): void {
|
||||
if (props.acct == null) return;
|
||||
user = null;
|
||||
user.value = null;
|
||||
os.api('users/show', Misskey.acct.parse(props.acct)).then(u => {
|
||||
user = u;
|
||||
user.value = u;
|
||||
}).catch(err => {
|
||||
error = err;
|
||||
error.value = err;
|
||||
});
|
||||
}
|
||||
|
||||
@@ -48,15 +48,15 @@ watch(() => props.acct, fetchUser, {
|
||||
immediate: true,
|
||||
});
|
||||
|
||||
const headerActions = $computed(() => []);
|
||||
const headerActions = computed(() => []);
|
||||
|
||||
const headerTabs = $computed(() => []);
|
||||
const headerTabs = computed(() => []);
|
||||
|
||||
definePageMetadata(computed(() => user ? {
|
||||
definePageMetadata(computed(() => user.value ? {
|
||||
icon: 'ti ti-user',
|
||||
title: user.name ? `${user.name} (@${user.username})` : `@${user.username}`,
|
||||
title: user.value.name ? `${user.value.name} (@${user.value.username})` : `@${user.value.username}`,
|
||||
subtitle: i18n.ts.following,
|
||||
userName: user,
|
||||
avatar: user,
|
||||
userName: user.value,
|
||||
avatar: user.value,
|
||||
} : null));
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user