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:
zyoshoka
2023-12-07 14:42:09 +09:00
committed by GitHub
parent e42c91dee7
commit 406b4bdbe7
277 changed files with 3353 additions and 3441 deletions

View File

@@ -47,7 +47,7 @@ SPDX-License-Identifier: AGPL-3.0-only
</template>
<script lang="ts" setup>
import { watch } from 'vue';
import { watch, ref, computed } from 'vue';
import MkFoldableSection from '@/components/MkFoldableSection.vue';
import MkPagination from '@/components/MkPagination.vue';
import MkGalleryPostPreview from '@/components/MkGalleryPostPreview.vue';
@@ -61,9 +61,9 @@ const props = defineProps<{
tag?: string;
}>();
let tab = $ref('explore');
let tags = $ref([]);
let tagsRef = $ref();
const tab = ref('explore');
const tags = ref([]);
const tagsRef = ref();
const recentPostsPagination = {
endpoint: 'gallery/posts' as const,
@@ -82,7 +82,7 @@ const likedPostsPagination = {
limit: 5,
};
const tagUsersPagination = $computed(() => ({
const tagUsersPagination = computed(() => ({
endpoint: 'hashtags/users' as const,
limit: 30,
params: {
@@ -93,10 +93,10 @@ const tagUsersPagination = $computed(() => ({
}));
watch(() => props.tag, () => {
if (tagsRef) tagsRef.tags.toggleContent(props.tag == null);
if (tagsRef.value) tagsRef.value.tags.toggleContent(props.tag == null);
});
const headerActions = $computed(() => [{
const headerActions = computed(() => [{
icon: 'ti ti-plus',
text: i18n.ts.create,
handler: () => {
@@ -104,7 +104,7 @@ const headerActions = $computed(() => [{
},
}]);
const headerTabs = $computed(() => [{
const headerTabs = computed(() => [{
key: 'explore',
title: i18n.ts.gallery,
icon: 'ti ti-icons',